3v4l.org

run code in 300+ PHP versions simultaneously
<?php function repeatInt(int $val, int $min, int $max) { $validValueNum = $max - $min + 1; $result = ($val %$validValueNum + $min) % $validValueNum; if ($result< 0) { $result= $validValueNum + $result; } return $min + $result; } // ?????? foreach (range(-10, 5) as $i) echo $i .'='. repeatInt($i, 2, 5) . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
-10=2 -9=3 -8=4 -7=5 -6=2 -5=3 -4=4 -3=5 -2=2 -1=3 0=4 1=5 2=2 3=3 4=4 5=5

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