From: Barel <[email protected]> 
Sent: Saturday, April 4, 2026 5:06 PM
To: PHP internals <[email protected]>
Subject: [PHP-DEV] [RFC] [Discussion] array_get and array_has functions

 

Hi,

 

I would like to open the discussion on my proposal to add two small, focused 
array functions for retrieving and checking nested array elements using dot 
notation.

This is the link to the RFC: https://wiki.php.net/rfc/array_get_and_array_has

This is the link to the proposed implementation: 
https://github.com/php/php-src/pull/21637

 

Thanks!!

 

Carlos

 

Hey,

 

Very useful functions!

 

Why did you decide to not handle keys with dots? It would prevent these 
functions from being used in tools that might sometimes receive something like 
`example.com`as the key. The similar userland functions that I’ve seen do at 
least support the exact dotted key as well, even if not offering a full 
dotted<->nested equivalence with priority rules, partial nested-dotted and 
other fun stuff.

 

I’ve also found it quite useful to have `[‘user.name’ => ‘Alice’]` be 
equivalent to `[‘user’ => [‘name’ => ‘Alice’]]` for testing/mocking more 
complex structures.

 

BR,

Juris

Reply via email to