Main Page

PHP Syntax Errors

New user registration will be down until the end of July.

This wiki is for sharing information about syntax errors in PHP. It is probably going to start somewhat slowly, but I'm okay with that.

See the Community Portal for information about how you can contribute, about the project, and about our community.

Common syntax errors

 * Call to undefined function
 * Call to undefined function curl_init
 * Invalid argument supplied for foreach
 * syntax error, unexpected T_(something)
 * syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
 * syntax error, unexpected T_OBJECT_OPERATOR
 * syntax error, unexpected bracket
 * expecting comma or semicolon
 * Using $this when not in object context
 * failed to open stream: No such file or directory
 * Function name must be a string
 * Non-abstract method Foo::bar must contain body
 * Cannot access empty property
 * Call to a member function foo on a non-object
 * Cannot modify header information - headers already sent

Other topics

 * Debugging