3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['A'=>1, 'B'=>2, 'C'=>3]; for($r = 1; $r <= 6; $r++){ foreach($a as $k => $v){ $e = $r; $e -= $v; echo "$r - $v = $e\n"; if($e <= 0){ echo "return $k\n"; break; } } }
Output for git.master, git.master_jit, rfc.property-hooks
1 - 1 = 0 return A 2 - 1 = 1 2 - 2 = 0 return B 3 - 1 = 2 3 - 2 = 1 3 - 3 = 0 return C 4 - 1 = 3 4 - 2 = 2 4 - 3 = 1 5 - 1 = 4 5 - 2 = 3 5 - 3 = 2 6 - 1 = 5 6 - 2 = 4 6 - 3 = 3

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:
55.43 ms | 2045 KiB | 4 Q