3v4l.org

run code in 300+ PHP versions simultaneously
<?php function contains($start, $end, $check) { return $check > $start && $check < $end; } function overlap($a, $b) { return contains($a[0], $a[1], $b[0]) || contains($a[0], $a[1], $b[1]); } function checkListForOverlaps($list) { for($i=0,$c=count($list); $i<$c; ++$i) { for($j=$i+1; $j<$c; ++$j) { if( overlap($list[$i], $list[$j]) ) { printf("%s and %s overlap\n", json_encode($list[$i]), json_encode($list[$j])); } } } } $input = [[1, 3],[3, 7],[9,INF], [2, 5]]; checkListForOverlaps($input);
Output for git.master, git.master_jit, rfc.property-hooks
[1,3] and [2,5] overlap [3,7] and [2,5] overlap

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