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 7iJ9A
Output for 7.0.0 - 7.2.0
foo Notice: Accessing static property a::$d as non static in /in/YGpUj on line 8 Notice: Undefined property: a::$d in /in/YGpUj on line 8 foo bar
Output for 5.3.19 - 5.6.28
foo Strict Standards: Accessing static property a::$d as non static in /in/YGpUj on line 8 Notice: Undefined property: a::$d in /in/YGpUj on line 8 foo bar