Re: Proposal for a new array function

From: Date: Tue, 09 Feb 2016 00:56:08 +0000
Subject: Re: Proposal for a new array function
Groups: php.internals 
Request: Send a blank email to internals+get-91136@lists.php.net to get a copy of this message
On the proposal for a new function to array that could be called has_numeric_keys I believe would be the most appropriate as the name of the function as well as its functionality. I believe that the creation of a typo checking function would be more interesting. In other languages array contains only numerical keys while hash have arbitrary keys. So creating a function is_hash as would be the case. Sample: $arr = [1, 2, 3]; is_hash (arr $) // -> false $hash = [ '23' => 'FOO', 'baz' => 12 'bar' => 89]; is_hash ($ hash) // -> true

« previous php.internals (#91136) next »