3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isAssoc($array) { $array = array_keys($array); var_dump($array, array_keys($array)); return ($array !== array_keys($array)); } var_dump(isAssoc(array(0=>'a',2=>'b',1=>'c')));
based on rGc32
Output for 4.3.0 - 7.2.0
array(3) { [0]=> int(0) [1]=> int(2) [2]=> int(1) } array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } bool(true)