3v4l.org

run code in 300+ PHP versions simultaneously
<?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++) { (new ReflectionClass($foo))->getName(); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); $refl = new ReflectionClass($foo); for($i=0; $i<$rounds; $i++) { $refl->getName(); } echo (microtime(true) - $start);

preferences:
33.06 ms | 402 KiB | 5 Q