3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Foo; class Bar { const BAZ = 'hello'; } $f = new Bar; var_dump(Bar::CLASS); // dumps "Foo\Bar" var_dump($f::BAZ); // dumps "hello" var_dump($f::CLASS); // Results in syntax error
Output for 5.5.0 - 5.5.9
Parse error: syntax error, unexpected 'CLASS' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/si06v on line 14
Process exited with code 255.
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'CLASS' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/si06v on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /in/si06v on line 12
Process exited with code 255.