3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a extends stdClass { const b = 'foo'; public static $d = 'bar'; } $c = new a(); echo $c::b; echo $c->d; echo a::b, PHP_EOL; echo a::d, PHP_EOL;
based on 32iso
Output for 7.0.0 - 7.2.0
foo Notice: Accessing static property a::$d as non static in /in/7iJ9A on line 8 Notice: Undefined property: a::$d in /in/7iJ9A on line 8 foo Fatal error: Uncaught Error: Undefined class constant 'd' in /in/7iJ9A:10 Stack trace: #0 {main} thrown in /in/7iJ9A on line 10
Process exited with code 255.
Output for 5.3.19 - 5.6.28
foo Strict Standards: Accessing static property a::$d as non static in /in/7iJ9A on line 8 Notice: Undefined property: a::$d in /in/7iJ9A on line 8 foo Fatal error: Undefined class constant 'd' in /in/7iJ9A on line 10
Process exited with code 255.