# [RFC] [VOTE] array_get and array_has functions

- Thread: https://externals.io/message/130947
- Original archive: https://news-web.php.net/php.internals/130947
- Started by Barel on 2026-05-18T20:00:39+00:00
- Messages: 4
- RFC: array_path_get and array_path_exists functions (Declined) — https://externals.io/rfc/array_get_and_array_has.md
- 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

---

## #130947 — Barel — 2026-05-18T20:00:39+00:00

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

Hi,

I started the vote on this RFC:
https://wiki.php.net/rfc/array_get_and_array_has

Voting ends 2026-06-01 20:00 UTC

Cheers

Carlos

---

## #130948 — tim@bastelstu.be — 2026-05-18T20:11:38+00:00

URL: https://externals.io/message/130947#130948 · In reply to: #130947

Hi


> I started the vote on this RFC:
> https://wiki.php.net/rfc/array_get_and_array_has

The voting announcement should include a link to the discussion thread, 
which you forgot. I'm adding it here for convenience:

Discussion thread: https://news-web.php.net/php.internals/130559

---------

Please also add the voting thread to the references section. The correct 
link is: https://news-web.php.net/php.internals/130947

---------

As for the RFC itself - I voted against the RFC for the reasons that I 
mentioned in this email (non-array should error, not default): 
https://news-web.php.net/php.internals/130667

Best regards
Tim Düsterhus

---

## #131015 — Bob Weinand — 2026-05-25T23:55:18+00:00

URL: https://externals.io/message/130947#131015 · In reply to: #130948

Hey Tim and Barel,


> Hi
>
> 
> > […]
>
> As for the RFC itself - I voted against the RFC for the reasons that I 
> mentioned in this email (non-array should error, not default): 
> https://news-web.php.net/php.internals/130667


I actually think non-array should cause default behaviour, the same as 
missing.

The part which I don't quite agree with is having null as default - I'd 
rather have an error when the path does not exist, by default, and to 
default to a default value you need to explicitly specify it.


I also would suggest to replace a pure exists by a number how many parts 
of the path are missing.

E.g. array_path_missing($array, $path).


$path = ["foo", 0, "bar"];

if (array_path_missing($array, $path) == 0) // found.

if ($missing = array_path_missing($array, $path)) { die("Error: Key " . 
implode(".", array_slice($path, 0, -$missing)) . " missing"); }


Which lends itself pretty nicely to trivial nested array verification.


Overall I really liked this RFC, just the default behaviour of 
missing/non-array path entry is a bit disappointing.

I hope it'll be resubmitted with slight improvements there!


Thanks,
Bob

---

## #131114 — Barel — 2026-06-02T17:19:02+00:00

URL: https://externals.io/message/130947#131114 · In reply to: #130947

Hi

The voting period for this RFC has finished. There was 1 "yes" vote, 17
"no" votes and 6 "Abstain" votes. The RFC has been declined

Thanks to everyone who participated in the discussion and the voting

RFC:  https://wiki.php.net/rfc/array_get_and_array_has
Discussion: https://news-web.php.net/php.internals/130559
Voting thread: https://news-web.php.net/php.internals/130947

Cheers

Carlos



> Hi,
>
> I started the vote on this RFC:
> https://wiki.php.net/rfc/array_get_and_array_has
>
> Voting ends 2026-06-01 20:00 UTC
>
> Cheers
>
> Carlos
