3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $bar = mt_rand(); } $iterations = 1000000; $a = microtime(true); for ($i = 0; $i < $iterations; $i++) { $bar = mt_rand(); } $b = microtime(true); for ($i = 0; $i < $iterations; $i++) { foo(); } $c = microtime(true); $ab = $b - $a; $bc = $c - $b; $abcPercent = (($bc / $ab) - 1) * 100; printf('Direct: %s seconds' . PHP_EOL, number_format($ab, 4)); printf('Function: %s seconds (%s%% more!)', number_format($bc, 4), number_format($abcPercent, 2));
Output for git.master
Direct: 0.0212 seconds Function: 0.0380 seconds (79.19% more!)
Output for git.master_jit
Direct: 0.0321 seconds Function: 0.0459 seconds (43.11% more!)
Output for rfc.property-hooks
Direct: 0.0279 seconds Function: 0.0335 seconds (20.12% more!)

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:
51.94 ms | 401 KiB | 8 Q