3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo {} $foo = new Foo; $rounds = 1000000; $start = microtime(true); for($i=0; $i<$rounds; $i++) { get_class($foo); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); for($i=0; $i<$rounds; $i++) { $class = new ReflectionClass($foo) $class->getShortName(); } echo (microtime(true) - $start);
Output for 5.4.16
Parse error: syntax error, unexpected '$class' (T_VARIABLE) in /in/1EQv0 on line 20
Process exited with code 255.
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '$class' (T_VARIABLE) in 1EQv0 on line 20
Process exited with code 255.
Output for 5.3.25 - 5.3.26
Parse error: syntax error, unexpected T_VARIABLE in /in/1EQv0 on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_VARIABLE in 1EQv0 on line 20
Process exited with code 255.