3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = microtime(true); for ($i = 0; $i < 5000000; $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 < 5000000; $i++) { $array = [ 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ]; } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "Without compact time : $elapsed seconds\n";
Output for rfc.property-hooks
With compact : 0.26345491409302 seconds Without compact time : 0.024538040161133 seconds
Output for git.master_jit
With compact : 0.3649890422821 seconds Without compact time : 0.023203134536743 seconds
Output for git.master
With compact : 0.2676260471344 seconds Without compact time : 0.023232221603394 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:
49.8 ms | 779 KiB | 4 Q