1 2 3 4 5 6 7 8
<?php error_reporting(E_ALL); class x{}; $x = new x(); echo "this will cause a notice:\n"; echo $x->foo; echo "and this a fatal error:\n"; echo $x->{''}; // same as $y = ''; $x->$y;
1 2 3 4 5 6
this will cause a notice: Notice: Undefined property: x::$foo on line 6 and this a fatal error: Fatal error: Cannot access empty property on line 8