3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // string, null, bool, float, largest specified previous index function isIndexedArray($array) { return !(bool)count(array_filter(array_keys($array), 'is_string')); } isIndexedArray(NULL);
based on 9GIpP
Output for 7.2.0
Warning: array_keys() expects parameter 1 to be array, null given in /in/k0GSb on line 5 Warning: array_filter() expects parameter 1 to be array, null given in /in/k0GSb on line 5 Warning: count(): Parameter must be an array or an object that implements Countable in /in/k0GSb on line 5
Output for 5.3.19 - 7.1.10
Warning: array_keys() expects parameter 1 to be array, null given in /in/k0GSb on line 5 Warning: array_filter() expects parameter 1 to be array, null given in /in/k0GSb on line 5