public static function lintFile($filename)
    {
        if (!file_exists($filename)) {
            return false;
        }

        if (self::supported(self::SUPPORT_RUNKIT_SANDBOX)) {
            /** @noinspection PhpUndefinedFunctionInspection */
            return runkit_lint_file($filename);
        }

        $cmd = 'php -l ' . escapeshellcmd($filename) . ' 2>&1';

        exec($cmd, $output, $retcode);

        return 0 === $retcode;
    }
public static function lintFile($filename)
    {
        if (!file_exists($filename)) {
            return false;
        }

        if (self::supported(self::SUPPORT_RUNKIT_SANDBOX)) {
            /** @noinspection PhpUndefinedFunctionInspection */
            return runkit_lint_file($filename);
        }

        $cmd = 'php -l ' . escapeshellcmd($filename) . ' 2>&1';

        exec($cmd, $output, $retcode);

        return 0 === $retcode;
    }
public static function lintFile ( $ filename ) { if ( ! file_exists ( $ filename ) ) { return false ; } if ( self :: supported ( self :: SUPPORT_RUNKIT_SANDBOX ) ) { /** @noinspection PhpUndefinedFunctionInspection */ return runkit_lint_file ( $ filename ) ; } $ cmd = 'php -l ' . escapeshellcmd ( $ filename ) . ' 2>&1' ; exec ( $ cmd , $ output , $ retcode ) ; return 0 === $ retcode ; }
Check file syntax via runkit_lint_file if supported or via php -l
@param string File name
@return boolean
Check file syntax via runkit_lint_file if supported or via php - l