PHP error category

Type Errors

Runtime type contract violations.

Type Errors errors arise when runtime type contract violations 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
Argument must be of type Fatal error: Uncaught TypeError: save(): Argument #1 ($id) must be of type int, string given in %s on line %d fatal
Call to a member function on null Fatal error: Uncaught Error: Call to a member function %s() on null in %s:%d fatal
Division by zero Fatal error: Uncaught DivisionByZeroError: Division by zero in %s on line %d fatal
Implicit conversion loses precision Deprecated: Implicit conversion from float 8.5 to int loses precision in %s on line %d notice
Modulo by zero Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %s on line %d fatal
Passing null to non-nullable internal parameter is deprecated Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d notice
Return value must be of type Fatal error: Uncaught TypeError: findName(): Return value must be of type string, null returned in %s on line %d fatal
Trying to access array offset on null Warning: Trying to access array offset on null in %s on line %d warning
TypeError not caught by Exception Fatal error: Uncaught TypeError: %s in %s:%d fatal
Unsupported operand types Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s on line %d fatal

Helpful tools