Home > PHP > Function > Misc. > php_check_syntax()

php_check_syntax()

php_check_syntax - Check the PHP syntax of (and execute) the specified file

Syntax

bool php_check_syntax (string $filename, string &$error_message)

Arguments

  • filename - The name of the file being checked.
  • error_message - If the error_message parameter is used, it will contain the error message generated by the syntax check. error_message is passed by reference.

Description

Performs a syntax (lint) check on the specified filename testing for scripting errors.

Version

PHP 5 <= 5.0.4

Return value

Returns TRUE if the lint check passed, and FALSE if the link check failed or if filename cannot be opened.