Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130568 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id E8AB21A00BC for ; Sun, 5 Apr 2026 09:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775380057; bh=g3+8oooQxkVFp0MwvkLnIZCI/ogrHRbC+x/jLp2ESGI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=E0tX2r29GOYOdTp/sFlHP9zN+u1CqE1CTK7ZyMKDesOf1v8uHPVnYYNjqkt30qvih 5zCvgMz2fjzz1ZzqcKkZrsxrhtUnC/LjVdvTfMniRLNf2ABHD/KvOqrxKU2WiBaWZK kwBAI/iHKEI87p+wKRfMp2CSOV74iYsumc+m+7jWjdcC6Zb8e4myviQLcTU5tVLFDP PcvUuYMwliXvG0SPXeDwIVFt7iuKaKQCaL4/x8fTVV1Vl4PgTJreobBZiTGl/teCnP 1ddq8mU0N1LRkOd/KWZhxPj/Zj9hrsJJ2nZtKrAnBbPhcKsxSWoLpKITHh+aeD3uEy iBH7hTUI8qRxQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AFC0B18005D for ; Sun, 5 Apr 2026 09:07:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 5 Apr 2026 09:07:23 +0000 (UTC) Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-899a5db525cso26598766d6.3 for ; Sun, 05 Apr 2026 02:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775380038; cv=none; d=google.com; s=arc-20240605; b=S0foUcoGyEBSk8EYPF90NTrecPDbPUsALXOO0SfTn7lpqFO3cfiUkkcXmZyM07WdvG zUQ8+stlboPuOIjWRSA7Qj+oian5Np6UZO/fBdmLPW1GCfSvfUz3lPYRuhPkudHqPHc5 Gd1Q84kUQ12HNG7mVfqrDwjeczvBgMPyqixrq5RQdXScJeymczbsNeDIgXjyGmVhB5C3 yP870OU7eRoficN8jVvrUUPLSMjVnumifUsPHSGaSh3IOP6LnrqKsvKsoryUOXo3S60D iA2xzJSsS5FCnURLLMilsQ893l7oGURT6ZtTqEa3DA/wy+2STKTn2auIz3M4uJsXkPin 19NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=g3+8oooQxkVFp0MwvkLnIZCI/ogrHRbC+x/jLp2ESGI=; fh=+LlYwQmGPdaSd5QCTvE9YaFIPGdmMZW7VAuF+9xHgz4=; b=Ct+xr/agf9lqR0ufDt83YE/pcQCXvchNM2QGZ6WQ3UIEYJOfkaNTHwgSfCTe3etUWq yY0utESvodaPVjLdEdUO8FfaPiGktVz412JMpknlTnMmsWGkx3qKg7gpLR5Bm2aHLMT0 qJoANjREOQZRyFAa11jzx+pE0lbGCn/gTQ5bgrnlIcfYMI+AXzh7WuDiBhEEL0Sb2gIB 0YVzeTxeeKBkEYckR6IIse5FJH4KLluaaYEFh/ijWDA5Sg4vWYk53Vk2RGwv3hMRTAI7 QiE7M+2R+nmc7sJNC33rtz58ac9lUPdGXyWGbabCMMW9k7yhC+5+VPoYJhAah3prsfU+ ZNHA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775380038; x=1775984838; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=g3+8oooQxkVFp0MwvkLnIZCI/ogrHRbC+x/jLp2ESGI=; b=Zqbhw/FyaXPQJaEtaLeSZg5/qPjSn28eP7wPcA+YocrcbVRYvo0V9+A9AZn99yaSCk R/IN3B71AUEqtG7dBtElrCbNkrIdcB78oBGuZYlnwPLDKEuq7U6t2H18QYh1vmJ1lHA7 78U0ourhTm4JEw6efxk4ruCe2gYlmUw5QtyHH1RYCqnEhYC1Pxb4Blr7e2oVklQUv6DQ dnxyWvnW/mjpyHL7xGL0Qt/Yhlf0xba3D7vs+g1gxsUxBqitNyLBpfcw9lqnmaKn0O1n 4mqm/2cPfdoqyvgKc4z0Zu7ed8+chOHKpswcpHsTELFYTkEBj2if82ow1bnfKc0yStE3 nj9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775380038; x=1775984838; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g3+8oooQxkVFp0MwvkLnIZCI/ogrHRbC+x/jLp2ESGI=; b=LquvMDK/M16XG1dq5RHADJDBEyLio6XvZVNIraQI2H4SGcCpqzHRPG0eclTVb0fSa0 Y/4q3opAtb/H89xop0Zw/7GRSocBNEx+3exjsGTubApgAGr0WvXrVKl7QNt1JNSoNFSA 0GPs6RurxM4QKrfsMzWQy6cv48gzbzf6TqP+Zd6TRHFrDp7IQoBhaV0IqLe304niiZQp /IR02/1Gm4LZ0tCWQFWU0V/gULfyRzJdjTmmyt7E3EKDL8PBQ8d4f/QUkVXH3Cpa1xE/ OLwDljYa3GqmApQb+G/JiRYrf08q2Bpc2zHYnKmLyRDUsai7n+V8noc4W7UwLzCbKpXb PbfQ== X-Gm-Message-State: AOJu0YwKjdtuC4mR39tMYUQlLJQjMtl+MceWwBNdzNI42TMZZSD8FKhQ shpsgWPVZD9luXIi2ubdQwiWylIDNgGpp+iBORX1VhDQzGuGKkYgnARwQ7ZAqE50YzmakJPMOpX 1Q8PcExMn3/jH/OlP8rArkt3J2rUT6cY= X-Gm-Gg: AeBDiesna/apUn6Nhn7B2xMQVx/5ygEjwA/nQQ8PlQUB9Gfsn4XOpen79habj/rxmMp sEsBred3LhdkIiZhSD9i4ukvqITnGU4X0o/KyvQV86KJcN6Xh6aRT9DlKS7B8FVVYndn55lwDJq QGqiZfTT30wZiWZF6duM29BBFDmSxNtWE/XPfwoo/VQKZC2Y7jdIigU/heiJL4Vto2yFDU+aWd/ /fGzRNJv6zGmSqOxbz8szevs3jkBGQ9ElluqIbMxlZWEDxHOJ9Hup/3zPq5Voad6tRn2jxWJ6Bi hO+rJOxGh3pt3q70I9em7+GhM4y7UtLV7+HNKA== X-Received: by 2002:a05:6214:e65:b0:8a3:8f4c:3b63 with SMTP id 6a1803df08f44-8a70316e988mr140717966d6.19.1775380037481; Sun, 05 Apr 2026 02:07:17 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 5 Apr 2026 11:07:05 +0200 X-Gm-Features: AQROBzC0KA6wVP4prR_ycDAzT6gd8LlndlNspemxDnEh2rK4Hq0V-5NrXQxbXiQ Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] array_get and array_has functions To: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000079b7ee064eb2e024" From: barel.barelon@gmail.com (Barel) --00000000000079b7ee064eb2e024 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 4 Apr 2026 at 18:54, Alexandru P=C4=83tr=C4=83nescu wrote: > Hi Carlos, > > This sounds interesting. > > A mature solution used in JS is lodash, with the get and has functions: > - https://lodash.com/docs/#get > - https://lodash.com/docs/#has > Also, from what I could search, Laravel array helpers have this > functionality as well: > - https://laravel.com/docs/master/helpers#method-array-get > - https://laravel.com/docs/master/helpers#method-array-has > I was curious; did you research both, and maybe also other libraries? If > yes, it would be nice to mention this in the RFC. > > They have some options, like allowing the key parameter as a list of > strings as well. > And also escaping the dot in the key in one way or another. > > -- > Alex > Hi Alex, Thanks for your comments. I have updated the RFC with references to the Laravel and Lodash implementations Allowing the key parameter as a list of strings sounds really interesting, let me explore that possibility Several other people mentioned escaping dots as something important, so I will look into adding that to the implementation Cheers Carlos > > > On Sat, Apr 4, 2026 at 5:08=E2=80=AFPM Barel wr= ote: > >> Hi, >> >> I would like to open the discussion on my proposal to add two small, >> focused array functions for retrieving and checking nested array element= s >> 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 >> > --00000000000079b7ee064eb2e024 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, 4 Apr 2= 026 at 18:54, Alexandru P=C4=83tr=C4=83nescu <drealecs@gmail.com> wrote:
Hi Carlos,
This sounds=C2=A0interesting.

A matur= e solution used=C2=A0in JS is lodash, with the get and has functions:
=
Al= so, from what I could search, Laravel array helpers have this functionality= as well:
I was curious; did you re= search both, and maybe also other libraries? If yes, it would be nice to me= ntion this in the RFC.

They have some options, lik= e allowing the key parameter as a list of strings as well.
And al= so escaping the dot in the key=C2=A0in one way or another.

--=C2=A0
Alex

Hi Alex,

Thanks for your comments. I have update= d the RFC with references to the Laravel and Lodash implementations

= Allowing the key parameter as a list of strings sounds really interesting, = let me explore that possibility

Several other peop= le mentioned escaping dots as something important, so I will look into addi= ng that to the implementation

Cheers

Carlos
=C2=A0<= /div>
=C2=A0

On Sat, Apr 4, 2026 at 5:08=E2=80=AFPM Barel <barel.barelon@gmail.com> = wrote:
Hi,

I would like to open the discussion on my p= roposal to add two small, focused array functions for retrieving and checki= ng nested array elements using dot notation.

This is the link to the= RFC:=C2=A0https://wiki.php.net/rfc/array_get_and_array_has

= This is the link to the proposed implementation:=C2=A0https://github.com/php/p= hp-src/pull/21637

Thanks!!

Carlos
--00000000000079b7ee064eb2e024--