3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { public function baz() { return strlen('Regarding the overhead: Just keep in mind, that a typical application calls built-in functions many thousand times. Even if the difference is small: It exists.'); } } } $start = microtime(true); $foo = new Foo\Bar; for($x = 0; $x < 1000000; $x++) { $foo->baz(); } echo "Time: " . round((microtime(true) - $start ) / 1000000, 5) . 's';
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
Fatal error: No code may exist outside of namespace {} in /in/dMVnV on line 10
Process exited with code 255.

preferences:
174.25 ms | 1395 KiB | 61 Q