I encountered an interview question today. Make sure chmod is executed successfully. Please help me solve it!
$file = 'path/to/file'; $mode = 0755; if(@chmod($file,$mode) === false) throw new \RuntimeException("$file can not change mode to $mode");