3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=62476 function factorial($i){ return ($i==1)?1:$i*factorial($i-1); } $a = array(); for ($d=1; $d<10; $d++) { $a[$d] = $d; } foreach($a as $b => $c){ echo "\$a[$b] == " . factorial($c) . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
$a[1] == 1 $a[2] == 2 $a[3] == 6 $a[4] == 24 $a[5] == 120 $a[6] == 720 $a[7] == 5040 $a[8] == 40320 $a[9] == 362880

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