Sometimes, while coding in PHP we get parse or syntax errors like those:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /var/www/example/index.php on line 4
I would like to know, if there is a list of all possible errors that PHP interpreter can output. I've searched php.net, but couldn't find such thing. I need this list for academic purposes.
Quickly Show All PHP Errors The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
No there is no good way. Even the suggested grep for zend_Error() is useless. The errors of the kind you're showing in the question is mostly generated by the bison parser generator and PHP simply takes it from there. Similar things happen with errors reported by the operating system (like errors when opening files). The PHP developers can't really generate a good list for these as the errors depend on the operating system it is running on and versions used while compiling.
The only thing grepping for zend_error() and php_Error_docref() can show you is a general overview of possible error kinds but by far not all error messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With