Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123783 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 qa.php.net (Postfix) with ESMTPS id 327851A009C for ; Mon, 24 Jun 2024 15:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719244699; bh=NwgNaBI/U3ZmTz8/+S5IjRwi0P3lroXhzT11qm5j0yQ=; h=Date:To:From:Subject:In-Reply-To:References:From; b=DW/o/KNI5VELqgPSVi0LzcMNMPJm19A5GE1JE+eZMxZSWyON8r2/9S4dsswXHYu0H Qbv5gi0NqE+9hGzLI/G6Tm0uaKLA7PH7BGJlQlhL7gvE91Jel0MJ7ioLwkS0LvIGFF 7jdDqASVUxCQS9YmXJT+bTfNV3oa435coE5Q2WR0/kQ4PBtmhYacufYRhfYd3kkfK5 BDdz7PFqmgZyBmQknDUVfpR50ZPqeprAwEIZA2XXUIA+2Q+kGSneDTPFiFMmyprAH5 OguRWo4Hkpk8nLkgSFrvOANLOsSL9DqK2ukcaGLTR4BfIZIZ4IUnnngq6q7/Tqy1sr kbtKRHZCdh03A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B10851805E8 for ; Mon, 24 Jun 2024 15:58:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) (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 ; Mon, 24 Jun 2024 15:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chaz.works; s=protonmail2; t=1719244617; x=1719503817; bh=VgDHpEShoEcn8ly9r3LJ2KDPzxsWYaeFTTX8qlOS8xw=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=HhdeXrQsb4sNG0NSOBMw6jHOraYC6ze6NtcrSAWmBGetxvs1Cg/zkJq8XVMiG88z/ 3cERmSU6fXb0Bs+CzxsNLMD3HDV9BCLLFWNdcalWc6FEH8rfzUnDUSp2ZID/Sxhix8 S7h/d9cwZyhzME1kXE9r40vV9nzDOo0vLi9rnT/Dn+1Sfc8E+JkYkxnzgbb7Lqhdw7 zeOnBk04wruBi+nIg6Y6xbv8+qp0tNv0d8XvBfS7KtcnDj2/RIDOLZpySENTuUcFO3 06EXMJwwE+Rewjxd/hVAGqH1xGoLCKvIAGbfdZptuY1vMFi7whqtLIJrj/3dkcG1VI rLGmAwYuNTIew== Date: Mon, 24 Jun 2024 15:56:51 +0000 To: php internals Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Message-ID: <1E295280-619B-4490-B53C-0899B64F9215@chaz.works> In-Reply-To: References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> Feedback-ID: 95748689:user:proton X-Pm-Message-ID: 8d46666b36779c98312d1891d2c9157e72cc1c26 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: chaz@chaz.works (Chuck Adams) > On Jun 24, 2024, at 3:31=E2=80=AFAM, Robert Landers wrote: >=20 >=20 > There's no need to use `?` to check for existence on a key, so this: >=20 > $arr is ['a' =3D> string, ?'b' =3D> string, ...]; >=20 > should be this: >=20 > $arr is ['a' =3D> string, 'b' =3D> ?string, ...]; >=20 > because $arr['non-existent-key'] is NULL. >=20 The first means b is an optional key, but if it=E2=80=99s there, can only b= e a string. The second says b is a required key, but it may be a string or = null. If there were a binding involved, that determines the type of the bin= ding in incompatible ways. I=E2=80=99m fine with requiring bindings to be = nullable for optional keys, but it strikes me as strictly less flexible and= not consistent with the rest of PHP=E2=80=99s behavior, at least not under= E_ALL. (Sorry for any dups. juggling sender addresses to make the listserv happy,= fixed an incomplete thought while I was at it) Cheers, chuck