Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all the possible PHP errors

Tags:

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.

like image 483
Silver Light Avatar asked Mar 01 '10 10:03

Silver Light


People also ask

How do I see all PHP errors?

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);


1 Answers

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.

like image 194
johannes Avatar answered Sep 30 '22 13:09

johannes