Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130561 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 A045F1A00BC for ; Sat, 4 Apr 2026 16:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775321665; bh=AbYXI+n3xsTvDnsOWLiVzO6vfNpWR9+e/0xeyGOwfAU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=flDLTVZ21wJntgGoBVDp3uTTzlPUHdb++iG4A6xQxUVvz3rPsCjD4d+4a5ywm8wmJ U29mrVlYfWoOm5kWceZDwhk+2mpACvBDfoRzyzRhELGTiAFMcu4/vxeeNw6zxqYoO7 IbCaBe1qsImFLSJVMXq7aRsYk1knkJ9VMSsGKn2HnodrsR1MB/qf8SkLao93qKRbmc +UPUrAw1iJnb9zx15XoO4z8rO+kLTRN8GwtIpLk7i64x6/jBsNNM0bQwvKRSezc3gu 92B+eFu8A/9x74Cx4XHGr4tC1i8u4FeXiRm07jWr/tjPJpQVKqrNUlxrHJv31eK8gw QaE6XhlVWuWQw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 77459180069 for ; Sat, 4 Apr 2026 16:54:23 +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-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 ; Sat, 4 Apr 2026 16:54:19 +0000 (UTC) Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-8a15ebb3abbso42216126d6.1 for ; Sat, 04 Apr 2026 09:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775321654; cv=none; d=google.com; s=arc-20240605; b=ABiLn0PSpdJjev8ittJ37bCspcqD+qDPo0ZPRrQQRJhyIZaeoHINmxnMvuJoQtLjhT SXs56F5k4rPlofUxvvjj3cw7hNmDrLf/8Cq73wXh/e8Lo3k7qBlFFunS1h1e7LfFbb53 SeE9QusR7jqcKwQ3w00pJvAAXBHClbu18LYLvRyG0Wp0D8b+JUokxMEwAfiSeiHyeSqP McDilKk0WY4UKugsFvOXkDxZ0Ynb6RYuKjpm9r8yg+gd1qzJT7weDvwGZFciaOMzRhEh Y1qR1zwnX+YNnUlTbJvNCqcklguJFzsHRwMzOCBWoAhIlQlAGKBQ80uTThZ05UMXLKfi AsFA== 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=AbYXI+n3xsTvDnsOWLiVzO6vfNpWR9+e/0xeyGOwfAU=; fh=H+xpp58yGTMflPDUjzzUel7JOjczCf84ecYRcBizoTc=; b=j4oogSanENhutrF9q9y9kqOFG8BmWzhoR4sp7Fy5/SyLz+9VAEIjFHpwRfrU1igd3S oHM0bXk+gMQ+pExGT7sl8ANDW/i1tFRFlt/iTzJea71efAo5SgVY9RicudYQnM2ztf6z C9RDFN0V57zRBMWaoZTHe7ilbJWcgGTzXcLHJkciI5+wpwgDKaJ7tdJLRrf/iirvkJyp Bx0oBaDXcPfl6Md09SYCi3VBWnoiA7tOKiTONbNpBoaSxfmdtEURjg5ki50UfTFcuRAM DYeVo6DVhX583fXo4M0nqS9A2fFwqnAf2YjHaWuUoxMbjb78zSCTv7GnVqE4fvJPNU2i Cmqw==; 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=1775321654; x=1775926454; 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=AbYXI+n3xsTvDnsOWLiVzO6vfNpWR9+e/0xeyGOwfAU=; b=RxNib6fwMu/l8oufOXVLO3wfteBdyIgj5FsQfxOKlHixRF2KX9jjSsCLAq6Fjt4Bjc cda3/35WNrgwwgySGSUUzKBIjRNgoOSSM1NnNWfKpz1wORjkA71Bn2Z/bfT08H0ErEtP BcbTw3PLbXSVr9fPTRpTA4Rm4Lm3Rqq/EOhXrh2uOKW+T2r7wM7GtJ4neUJcMmDr/N09 /d3cZ9yy7+wWldYJojzadH3z2ZWKouFQsmkAbjrPkazVvfYSReFQjAWDep/FxN000v8v +/tDw7gercpCSyBamKrcie9iirhFySc2zpMkInCuBBRUxrGdsqSIX9KetangXvV4HGaQ jaIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775321654; x=1775926454; 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=AbYXI+n3xsTvDnsOWLiVzO6vfNpWR9+e/0xeyGOwfAU=; b=BmU+ei6B0q+P6g1r1daeOXzQeNIxnoV9TGLRcz3Ie+8k67x5Qdt3DWDlSTxz8PJrTf 5wzSjec96XBwb9kr67fE9inPAmI9pA3JWY/Qs8oPK6gyorrzR32A+MGVa2EIxytJQ3mJ FGscp8qhaXa5x8z8y4o35q+BMhQyuqJzwyIerSc06DAUIwqtQyGxHOaZa9lqryOWcn4M HNVOopZAfOgM0jfYKHnRXhbKho4iyQRPxGeAF1W8yxK/c3gZ2KMFosgBAnAVMxA5ksxT d9DaU0M6xXwY425WQU60gYaK1NVdXN8N6cToocHGmxxFoSbu1E2Gm1EjvE7BCxzgHNGz sjUg== X-Gm-Message-State: AOJu0YwAmn5BAeYrK/4E8jsKecuWi23JHEYYhoFxekHEKyBrNh+K5uba R4sYyS2h7TH4kEW3Hj2EXVnfpOExGL+ma9qzfJ5Jqaqjc/1MQOv9B65aGseDfV0f/Mqkf8c49Wd 9Lc5Wg1WtR1q2EXsIpGeGO/Br5k6QD8I= X-Gm-Gg: AeBDievH4SY2wcSuSCFXFHqkXy18XAK+wmcsEJdehXcMsNwftMZxqC4g1Upla02lzPi mTu48UTr5Ke/3qrfZGZbhVOOgJmZYYTQT5iKf6w53twNL8WPiaamtggI3SyS7wPfzVthdacKViT uMefGHylA5NjU/nIdG9JvskQIdokW0udQLmIiXTWrjNISw3PUq4jGStKH+jJ74ERta3V00+FN85 UooqO+6o/CLezRQHi+hMWvLw4znz9+PsQx8jBmXZO3ylG/WJXopJSDSj6EYYoT1HuIK33ts1woa Ah7jYgg= X-Received: by 2002:a05:6214:19e2:b0:8a0:7c8:4098 with SMTP id 6a1803df08f44-8a7025b3707mr120231216d6.6.1775321653972; Sat, 04 Apr 2026 09:54:13 -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: Sat, 4 Apr 2026 19:53:57 +0300 X-Gm-Features: AQROBzBB28zR9JhL1jI7-YhK7kHVsu7oKGO7Hdp4uRQjMREmOZhA86tjLuw8m5M Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] array_get and array_has functions To: Barel Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000008c14c6064ea5488d" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000008c14c6064ea5488d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. --=20 Alex On Sat, Apr 4, 2026 at 5:08=E2=80=AFPM Barel wrot= e: > 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 > --0000000000008c14c6064ea5488d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Carlos,

This sounds=C2=A0= interesting.

A mature solution used=C2=A0in JS is = lodash, with the get and has functions:
-=C2=A0https://lodash.com/docs/#has
Also, from what I could search, Laravel array helpers have this func= tionality as well:
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 paramete= r as a list of strings as well.
And also escaping the dot in the = key=C2=A0in one way or another.

--=C2=A0
Alex
=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 proposal to add two small, focused array functions for re= trieving and checking nested array elements using dot notation.

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

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

Thanks!!

<= /div>
Carlos
--0000000000008c14c6064ea5488d--