Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130571 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 438E61A00BC for ; Sun, 5 Apr 2026 09:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775381489; bh=vyHtgb/U2b5zbqLz/NvriTWIUYo+dT5oyTZ5IYJ0AJc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eWbb1NCLakg80vosusaAEjiNYnprKGgxTtw/C+IcgRgJx2JZ5a00sMHmERTeGdyZK bLFkvomfdBLvFwKBi/+FOfFqLpfzrx4KXEURIiXk21pSyiZIZtPrFiq7YX9ndrt0hK VXDJFZyb5PQX/qsq3y7AeSY8sa7dWTwM5vCi9OuOnrvukfXwintz7+WwHIxci3wT6t Ad6Q3CiwbR84CDj1r+NAR8cr9ZYVbdk5Ou92XvceBfX85Ep99bHT6g1wv6vPkXUHBk e7iucam8Pc9YcPbKtn4W5B2SrUse0z3VM3fQ52BUVc63l5ZLvymzEsn1FEJLNTqv0S hS2CrOO3fdgEw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2074D180061 for ; Sun, 5 Apr 2026 09:31:29 +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-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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:31:28 +0000 (UTC) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-89cc68655f8so33528906d6.0 for ; Sun, 05 Apr 2026 02:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775381483; cv=none; d=google.com; s=arc-20240605; b=SrNZnZpeWHYsKmF1t9K+PC9FZNH3M1cjvglbreKtcNxYDwO7mjlNztshqEGY5l11G1 uChtCDkn9RNmRekSRiVboasliyRTNGlOZqAG1w2SNKAO+u5w2Y7FGQVt/bl/r1U1lnP2 s27o3oWsyzX6i0DmmH/yu8jx0k1q0EGxabFw1p/ESOZfK/rClwkCCp+LEque1TCEyCix FEeX0lYCCiHYQwoo2+AFvtOQIYcmZt3x+ambOZ9+FiVGqin8GLd1U/ratmeSOHS6LuMa 40ZWPNjp4/r6w0gMlGGjoq5O4VNmyat7XhGS9SeLTfF81YgI6p1CVQ/KgrQPB7D4hKVV hvhQ== 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=6s/r1MPdCchpsnB1ywkprOlrnlDh/MpORJZ3poDhMQU=; fh=IVJOKO8+dqusO1ftHvO6BQus2DxrSnSnbi+8m92NGD4=; b=ReeEc5d6ia0/5x+xPeQCJT4LE266RE1uvTssHgFN+ZPoGYaGA80qkgc9RoMkb9Np5C 4zJJqiVMJmlgsnuVBNmBhPxYYBXs0UENkcJlY5Ny7D4ygPlHZ9q/zsnk1bXDQ/GDDT+o 3auXkr6ddzURVszqR9lXSi/4LY9nklq1lCdV2AtSBJ7AkVmRFfCEFft1Afc1MQoZQg4B eObwKPBvtF6zj1/Ce5q3aMrYXIM2PaM/jm3kuYgloYxggqAOjCx+Cp/aqlBdVWhYo+Mx 0HVxWB6bXqsOG0h2iWZX2laYCP5CrK1H5nyInf6OZIrEGa6KnqvCnPXGkVcyntmFkZFi /WCw==; 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=1775381483; x=1775986283; 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=6s/r1MPdCchpsnB1ywkprOlrnlDh/MpORJZ3poDhMQU=; b=FbCCAZliFfkSdwNPtYHGZ6YE2hVACSO6QKUXT2cnLquH3vReRKbB67vjplxZW3pXqv +x+5N+AaQz++f2WaEN0ej7uH/xbs4zSUC1kGlSLgqCFLvzzatw8950F7BEPlz/Nt1Gm2 iNNywF1Qc2gW+zaxbnv+zpAyfys+7IMxuCHVkrdZ9d/s1xIuSyseSL0r4sKgd/kcTOOT LknHUqb9C8wUl47Gqa0UsaXjIIXPleH+Tftyc9Ix58U19Sja3TbP+3ewH/tytl42VOuM LnCEJE+3u1wiLrhj8CdXkkVNXEKO1vvY5O8rwY++kVQsyzuxTIrDCVrp3HcX9vt99+Wk nmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775381483; x=1775986283; 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=6s/r1MPdCchpsnB1ywkprOlrnlDh/MpORJZ3poDhMQU=; b=lJ7nVauE5kXSA9Rw9by2PWqBfH5J/cpTjBjAYSA1G1RGjZjfLhSJrFGvgEuMor9Cfo 8cQ2It3XPVD0RguqMAznrUhXDeDd6eJg7WqgETVpGx7z0/yveF+vgJOoNyKseMAngp+e myG1TXRN+FzOSE6b6LMMfInxTN7HVG7se9UEY8koji6G5UWqrdbKU1o4RCNu2QyBTvAD zK+WdgIhsX2JaLtJZxEBrDMpJGGzjDkfNDDk0btjptLWe10/CFHpKyOeE1kBg8LDw8rC 4REqykcu7e6r51U/f1AAPmESxfNnK+f4iTiWzADZercNuLrsvm//yQbottLpb2P3uKkV PX+Q== X-Gm-Message-State: AOJu0Yzinsh2CitkCW7vO4bP/9KDyOCXtnLD02nOaQRwSgFhPKehUTA2 kJT9cqPWBnMwqt7MjyNOUTp241qjUdDoouNMsTvf1i2bB3Zh4Jjy8avEPipKQwkSP4tYv8HBum/ bzdeHc2/I/fkyiTW3qi/2eSIUUv3C+c89OQ== X-Gm-Gg: AeBDieurhdqdzr1KhuxOi8+zJ6k9QlM5KFhLCSxmB0o4kY4zGdTmBL5xuB7SNlR6Gk+ Yp1+sUoJmphoNyVmauLBTvyEPYv9LLB3241Ny3zU/cxkoKzZNtJIxbFO4/jUYuSY1UmFwfouhrZ SpkInPd5Yad4/L80RQcRQHMw7cs928WN9ZQ9/812nL6teLGBsANlJP8JL+hb7M8cZeohH2uvICO Jkpf5QwVuFiHsBEbyCIFegVaLkNPjmXV14M929UUmrmMtdUh5DywnnPmqP17CtOPUTQha8159B4 iVCCygS2bqi3oB2SZ0B9QeUFDQQPzXvx9AEHng== X-Received: by 2002:a05:6214:5249:b0:89c:4ce5:cc8b with SMTP id 6a1803df08f44-8a705e69ffdmr121363296d6.26.1775381483277; Sun, 05 Apr 2026 02:31:23 -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:31:11 +0200 X-Gm-Features: AQROBzAp4vZZNxbTdVrmADoam6MR8xbtX5c6xZtvHFl2VZDgk0os__jJPNMK1iA Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] array_get and array_has functions To: Aleksander Machniak Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000a6cfab064eb33605" From: barel.barelon@gmail.com (Barel) --000000000000a6cfab064eb33605 Content-Type: text/plain; charset="UTF-8" On Sun, 5 Apr 2026 at 08:17, Aleksander Machniak wrote: > On 4.04.2026 16:06, Barel wrote: > > This is the link to the RFC: https://wiki.php.net/rfc/ > > array_get_and_array_has < > https://wiki.php.net/rfc/array_get_and_array_has> > I'd prefer $key=null case removed. It's not that useful, not on pair > with array_has(), and one would debate what to do with the $default in > this case. > > I'm not sure this needs to be stated in the RFC, but I hope they do not > throw a warning when the key does not exist, on any level. > Thanks for your comments. I would like to hear what other people think about the `null` case. I find it useful but if other people think it is unnecessary, it can be easily removed. In any case, the $default would not be used in this case And, no, no warning will be thrown if any part of the path does not exist, being able to easily support not existing paths is one of the main reasons for this RFC Cheers Carlos > > -- > Aleksander Machniak > Kolab Groupware Developer [https://kolab.org] > Roundcube Webmail Developer [https://roundcube.net] > ---------------------------------------------------- > PGP: 19359DC1 # Blog: https://kolabian.wordpress.com > --000000000000a6cfab064eb33605 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, 5 Apr 2026 at 08:17, Aleksander M= achniak <alec@alec.pl> wrote:
On 4.04.2026 16:06, Barel wrote:
> This is the link to the RFC: https://wiki.php.net/rfc/
> array_get_and_array_has <https://wiki.php.ne= t/rfc/array_get_and_array_has>
I'd prefer $key=3Dnull case removed. It's not that useful, not on p= air
with array_has(), and one would debate what to do with the $default in
this case.

I'm not sure this needs to be stated in the RFC, but I hope they do not=
throw a warning when the key does not exist, on any level.
=

Thanks for your comments. I would like to hear what oth= er people think about the `null` case. I find it useful but if other people= think it is unnecessary, it can be easily removed. In any case, the $defau= lt would not be used in this case

And, no, no warn= ing will be thrown if any part of the path does not exist, being able to ea= sily=C2=A0support not existing paths is one of the main reasons for this RF= C

Cheers

Carlos

= =C2=A0

--
Aleksander Machniak
Kolab Groupware Developer=C2=A0 =C2=A0 =C2=A0 =C2=A0 [https://kolab.org]
Roundcube Webmail Developer=C2=A0 [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
--000000000000a6cfab064eb33605--