3v4l.org

run code in 300+ PHP versions simultaneously
<?php function outside() { $c = 100; $o = ''; $a = [ '1' => 'one', '2' => 'two' ]; while ( --$c ) { $o .= strtr( $c, $a ); } return $o; } function inside() { $c = 100; $o = ''; while ( --$c ) { $a = [ '1' => 'one', '2' => 'two' ]; $o .= strtr( $c, $a ); } return $o; } $it = 100; $ns = -hrtime( true ); $c = $it; $l = 0; while ( --$c ) { $l += strlen( outside() ); } $ns += hrtime( true ); echo "outside: " . ( $ns / $it / 1e3 ) . " µs/it\n"; $it = 100; $ns = -hrtime( true ); $c = $it; $l = 0; while ( --$c ) { $l += strlen( inside() ); } $ns += hrtime( true ); echo "inside: " . ( $ns / $it / 1e3 ) . " µs/it\n";
Output for git.master
outside: 26.86512 µs/it inside: 27.34174 µs/it
Output for git.master_jit
outside: 41.43078 µs/it inside: 39.93213 µs/it

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.08 ms | 478 KiB | 5 Q