3v4l.org

run code in 300+ PHP versions simultaneously
<?php // string, null, bool, float, largest specified previous index function isIndexedArray($array) { return !(bool)count(array_filter(array_keys($array), 'is_string')); } assert(isIndexedArray(NULL)); assert(isIndexedArray(['a']));

preferences:
50.01 ms | 402 KiB | 5 Q