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::d;
based on iaYAU
Output for 7.0.0 - 7.2.0
foo Notice: Accessing static property a::$d as non static in /in/32iso on line 8 Notice: Undefined property: a::$d in /in/32iso on line 8 Fatal error: Uncaught Error: Undefined class constant 'd' in /in/32iso:9 Stack trace: #0 {main} thrown in /in/32iso on line 9
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/32iso on line 8 Notice: Undefined property: a::$d in /in/32iso on line 8 Fatal error: Undefined class constant 'd' in /in/32iso on line 9
Process exited with code 255.