public function toFile(array $array, string $filename, int $flags = 0): bool
    {
        $dir = \dirname($filename);

        !\is_dir($dir) && \mkdir($dir, 0777, true);

        return (bool) \file_put_contents($filename, $this->dump($array), $flags);
    }
public function toFile(array $array, string $filename, int $flags = 0): bool
    {
        $dir = \dirname($filename);

        !\is_dir($dir) && \mkdir($dir, 0777, true);

        return (bool) \file_put_contents($filename, $this->dump($array), $flags);
    }
public function toFile ( array $ array , string $ filename , int $ flags = 0 ) : bool { $ dir = \ dirname ( $ filename ) ; ! \ is_dir ( $ dir ) && \ mkdir ( $ dir , 0777 , true ) ; return ( bool ) \ file_put_contents ( $ filename , $ this -> dump ( $ array ) , $ flags ) ; }
Dump and output to an external file.

@param array  $array    the array
@param string $filename the filename
@param int    $flags    the flags for file_put_contents()

@return bool success or not
Dump and output to an external file .