3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a extends stdClass { public const b = 'foo'; public $d = 'bar'; } $c = new a(); echo $c::b; echo $c->d;
based on deXIN
Output for 7.1.0 - 7.2.0
foobar
Output for 5.4.0 - 7.0.20
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/7mK6W on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_CONST, expecting T_VARIABLE in /in/7mK6W on line 3
Process exited with code 255.