# Proposal for a new array function

- Thread: https://externals.io/message/91136
- Original archive: https://news-web.php.net/php.internals/91136
- Started by marcelo everson Ramos on 2016-02-09T00:56:08+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #91136 — marcelo everson Ramos — 2016-02-09T00:56:08+00:00

URL: https://externals.io/message/91136#91136

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
