3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [1,2,3,4,5]; $y = [2,3,4,5,7]; $z = [10,11,12,13,14]; $f = [2,3,4,5,14]; function check(array $x) { sort($x); $isStraight = true; $lastNum = $x[0]; for ($a = 1; $a < 5; $a ++) { if (($lastNum +1) != $x[$a]) { $isStraight = false; } $lastNum = $x[$a]; } if (!$isStraight && $x[0] == 2 && $x[4] == 14) { $x[4] = 1; $isStraight = check($x); } return $isStraight; } var_dump(check($x)); var_dump(check($y)); var_dump(check($z)); var_dump(check($f));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(false) bool(true) bool(true)

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