Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119111 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2320 invoked from network); 12 Dec 2022 22:58:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Dec 2022 22:58:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A7730180503 for ; Mon, 12 Dec 2022 14:58:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 12 Dec 2022 14:58:43 -0800 (PST) Received: by mail-wr1-f50.google.com with SMTP id h7so13871142wrs.6 for ; Mon, 12 Dec 2022 14:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=TJykY90u3wzYfNMMxVzjrgPfg5Aq7pctL2tu7Ug275k=; b=L68XANZbJhEIUO+sMQ4EwucYVXylIj3iU9gU3O/jeH5QAWHN09uVif1FsGglS073KZ /6SEHMs0U2ESvlbukhmBs36CCVV2OuJ+N4+PMybJKH6aT6rEkVbWwGUamOA1XCb1ZcFh Sf4dB9exRmnzf+UVv0bUomQALvxEYdHJ+YKiNS5MR/ChOv6/ofTcKj2aEven0MorwnPj a4NcWaUneX2hyKggesiD1aX1hsVcbZivXdVFc6oF08kLyUsUWhHhERVaZTty2aKZEgzd zjg2W1o5R3MpNfj+xaCJxq0UdfHB/RI95W8EKYUgHs0wfAHRB5bV5+0rKVjlVUixdjHV FrDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TJykY90u3wzYfNMMxVzjrgPfg5Aq7pctL2tu7Ug275k=; b=kGqRoLEN5I7sphUtg4ochIp80ECClDy3CxvWyPuxBprKOY7fsXdDTx7ao8dySHFNYx uEXlfBMA151I4CTMqV4Oo64aJn61oH2wNZKy2eOjU69cmC4CVTgL1qlUAABoT2XF5fWo w/Rr+xVda5meKoDGqQj30HH4mVmxwG7r3Czprepd0FzfqFgNR7JKUzJjLQ1ThGgeQSFL DMbx2ccOX7LgTe/cVPLj2Fqp8UD/qVRGwC+1KnWSXvOlHam9tXeN6vps7DnqZdpB3DCQ 8o+ond78bS9y9uyS6EPwRqw4pXbiditJgxdj46GYb06EzSRBmKLTHj8i2f1pov/JPGjj OpCQ== X-Gm-Message-State: ANoB5pmyt7MoQR92Syr1sckQpvKZr7OEkSj0cIKAOSArvKhZz1e9yFJT d/ov5Eqh2UGOWRZcCva4hu8eAQwl/xA= X-Google-Smtp-Source: AA0mqf4hxMxndwz0udJDtXTroXvpS/QHvKb8lSlgI7wrdT3+knFBOMBdTyrzt6OhluaOCcZeMFwMvw== X-Received: by 2002:a5d:654c:0:b0:242:65d:c401 with SMTP id z12-20020a5d654c000000b00242065dc401mr12155385wrv.6.1670885922023; Mon, 12 Dec 2022 14:58:42 -0800 (PST) Received: from [127.0.0.1] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id az18-20020adfe192000000b002423a5d7cb1sm10160704wrb.113.2022.12.12.14.58.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Dec 2022 14:58:41 -0800 (PST) Date: Mon, 12 Dec 2022 22:58:38 +0000 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_Revisiting_RFC=3A_Engin?= =?US-ASCII?Q?e_Warnings_--_Undefined_array_index?= From: rowan.collins@gmail.com (Rowan Tommins) On 12 December 2022 22:20:27 GMT, Dan Liebner wrote: >Here's my biggest criticism: the change essentially forces this: >$arr['key'] > >to be rewritten as this (or some other intolerably bad alternative): >isset($arr) && isset($arr['key']) && $arr['key'] Fortunately, this is not the case, the actual replacement code is this: $arr['key'] ?? null There has previously been a suggestion of introducing an even shorter synt= ax, such as this: $arr[?'key'] (With the difference that only one key is marked optional, whereas ?? allo= ws any number of dimensions - $foo['bar']['baz'] ?? null would be equivalen= t to $foo[?'bar'][?'baz']=2E) This would avoid the inconsistency of configurable behaviour, and allow us= ers to make clear with a single keystroke that they know a key might be mis= sing, while giving them useful feedback for typos and other mistakes that l= ead to a key being unexpectedly missing=2E I think this is a general approach that should be more explicitly embraced= : introduce convenient syntax for valid use cases, while making accidents o= bvious=2E Regards, Hi Dan, --=20 Rowan Tommins [IMSoP]