PHP error category

Classes & Objects

Object model and property failures.

Classes & Objects errors arise when object model and property failures affect an executing PHP application or its supporting service. Use the exact signature and runtime context to narrow the cause before changing configuration.

The guides in this category separate code defects from environment differences, show focused diagnostics, and favor site-scoped corrections that preserve unrelated applications.

Guides in this category

Title Pattern Severity
Attempt to read property on null Warning: Attempt to read property "email" on null in %s on line %d warning
Call to a member function on null Fatal error: Uncaught Error: Call to a member function %s() on null in %s:%d fatal
Cannot declare class because the name is already in use Fatal error: Cannot declare class App\\Model\\User, because the name is already in use in %s on line %d fatal
Cannot modify readonly property Fatal error: Uncaught Error: Cannot modify readonly property Invoice::$id in %s on line %d fatal
Cannot redeclare class Fatal error: Cannot redeclare class CacheStore in %s on line %d fatal
Cannot use object as array Fatal error: Uncaught Error: Cannot use object of type stdClass as array in %s on line %d fatal
Class not found Fatal error: Uncaught Error: Class "%s" not found in %s:%d fatal
Class not found after Composer install Class "%s" not found error
Object could not be converted to string Fatal error: Uncaught Error: Object of class App\\Value\\Money could not be converted to string in %s on line %d fatal

Helpful tools