3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = microtime(true); for($i=0; $i<100000; $i++) { $foo = "foo"; $bar = "bar"; $baz = "baz"; $array = compact('foo','bar','baz'); } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "With compact : $elapsed seconds\n"; $startTime = microtime(true); for($i=0; $i<100000; $i++) { $foo = "foo"; $bar = "bar"; $baz = "baz"; $array = [ 'foo' => $foo, 'bar' => $bar, 'baz' => $baz ]; } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "Without compact time : $elapsed seconds\n";
Output for git.master
With compact : 0.015524864196777 seconds Without compact time : 0.011129856109619 seconds
Output for git.master_jit
With compact : 0.007066011428833 seconds Without compact time : 0.0045449733734131 seconds
Output for rfc.property-hooks
With compact : 0.01055908203125 seconds Without compact time : 0.0048189163208008 seconds

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:
45.16 ms | 408 KiB | 5 Q