3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isProgression($array){ return ($array == range(0, $array[sizeof($array)-1])); } function isProgression2($array){ $count = count($array); for ($i = 0; $i < $count; ++$i) { if($array[$i] != $i){ return true; } } return false; } for ($x = 0; $x < 1000; $x++) { // Pick one isProgression(array(0,1,2,3,4,5)); //isProgression2(array(0,1,2,3,4,5)); }
Output for 4.3.0 - 7.1.0