On 08/02/16 17:36, Markus Fischer wrote:
Hi,
On 08.02.16 18:06, Cesar Rodas wrote:
return array_keys($arr) !== range(0, count($arr) - 1);
`array_keys($array) === range(0, count($array)-1)`
That approach would fall flat when the numeric keys are not consecutive:
$array = [1=>"a", 3=>"b"];
Disclaimer: AFAIK complete goal of the function wasn't yet stated, thus
this could be considered /acceptable/.
cheers,
- Markus
I would read 'has_numeric_keys' as accepting any keys of type int or float.
Not sure if this was the intention, but would be my expectation from the
method name.
- Matt.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php