Undefined property %s::$%s¶
Description¶
This error is reported when reading an undefined property. The property must be defined before usage, or, in older PHP versions, the property must have been assigned.
This error is related to properties: a different error is emitted for static properties.
Example¶
<?php
class X {
public $a = 1;
}
$x = new X;
echo $x->a;
echo $x->b;
?>
Literal Examples¶
Undefined property x::$b
Solutions¶
Define the property before using it.
Fix the name of the property, and replace it with an existing one.
Define the magic property method __get() to make any property available.