3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public static $bar; } $foo = new Foo; $arr = array("", " ", FALSE, TRUE, array(), NULL, "0", 0, 0.0, new stdClass, $foo, $foo->bar, "\0"); echo Foo::bar; // foreach($arr as $val){ var_dump($val); }
based on YeU6g
Output for 7.0.0 - 7.2.0
Notice: Accessing static property Foo::$bar as non static in /in/Da2pg on line 4 Notice: Undefined property: Foo::$bar in /in/Da2pg on line 4 Fatal error: Uncaught Error: Undefined class constant 'bar' in /in/Da2pg:6 Stack trace: #0 {main} thrown in /in/Da2pg on line 6
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Strict Standards: Accessing static property Foo::$bar as non static in /in/Da2pg on line 4 Notice: Undefined property: Foo::$bar in /in/Da2pg on line 4 Fatal error: Undefined class constant 'bar' in /in/Da2pg on line 6
Process exited with code 255.