Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117116 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91350 invoked from network); 22 Feb 2022 11:06:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Feb 2022 11:06:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D37EE18053B for ; Tue, 22 Feb 2022 04:26:05 -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=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 22 Feb 2022 04:26:05 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id y24so12042188lfg.1 for ; Tue, 22 Feb 2022 04:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fyberstudios-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Iojl7b65qiy+Gy46AHLoYr1IgGJ104cUGzXGcL73wPw=; b=7U7y9U9X4r0ltAlMrVAoBWjTDzyPTRtdQPlr5qUrHZYyYQcqYMRgnpewWY/MZ8wrOY Xhx27tzphamLaUjck6qfeCn1Vs4KRTQfuFv//j2O6ef0nNNbwftRhHAvKHFKAs1DXZc9 vNBInvkRLtgxORXmM9lcCQVccBVzTkCV2os0u9xBKT3OwplwCDL01iXEgPCAdIg6mZlE qfZrjli7IG9VOcEsJ64O4CKXg4F8kqtlcE6AmC6yT0YHWsGrPghU2H1a8kvhT/bI1Fkh QvE6/Olnv0onOBGluj+3c8EWR8yCOdH/FbzCv9oMUssaoDWCCcoia8od9wDrsUQj1eU+ 7Hkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Iojl7b65qiy+Gy46AHLoYr1IgGJ104cUGzXGcL73wPw=; b=JIBuuHXmSMFzjopFASyM2sHVv/6ndje2dgkcoFRmr6tpefhEIRc8+FFZyBvEQ31grP 2LxyZcpwzYjuIWa4x5j+54Or1hgVwlmkXcoVeOXSmfuKCt32JWkk3S0Lva9cEbWwiRVA CGiF/PPS5jJu3aY4VqTJUUzz6dsXaG/cIcNMNgoGQjvco4W3eBm4oxrd5WloKTqNHkmJ GIb9YX3cmr+9l09YHEAcImBLKZq/l0jWeUZTnJ1KGFHu6Hpk7N9eXpWSCytioVkvORky kmQVXO0VSmQNHTVKq52bSNpSgNwL5l4LKLuoNRpS8+HVaUxJZEvG9y86dpHEmL5s+I8e 8fkw== X-Gm-Message-State: AOAM530tO4t7ROXGPHQisWIJrkjiiMsJx0oco5WmDWPYX1g0wtqyl7h3 +KSKYmvT9kOVsojMupZz7FRwBcJMvmQ644x1BQamnfyx X-Google-Smtp-Source: ABdhPJz+uuub2IRoizDaG/Z2XuPo8iGh5ZC0hahh4E6WvuLaXaYlFIDxueRSa2jgE/DtWL5DGnV0NTe2HW7fCPGv2DM= X-Received: by 2002:a19:a414:0:b0:443:13e0:45dd with SMTP id q20-20020a19a414000000b0044313e045ddmr16614157lfc.560.1645532763565; Tue, 22 Feb 2022 04:26:03 -0800 (PST) MIME-Version: 1.0 References: <620eda0f.1c69fb81.d2cb1.0846SMTPIN_ADDED_MISSING@mx.google.com> <5efecaef-a024-3c61-e12e-ffc342956718@gmail.com> In-Reply-To: Date: Tue, 22 Feb 2022 06:25:54 -0600 Message-ID: To: Nicolas Grekas Cc: Rowan Tommins , Mark Randall , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d6b19205d89a734f" Subject: Re: [PHP-DEV] [RFC] Undefined Variable Error Promotion From: nwallace@fyberstudios.com (Nick Wallace) --000000000000d6b19205d89a734f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have tried to no avail to be removed from this list. So I will just spam this until I am removed. On Tue, Feb 22, 2022, 3:15 AM Nicolas Grekas wrote: > Le ven. 18 f=C3=A9vr. 2022 =C3=A0 12:24, Rowan Tommins a > =C3=A9crit : > > > On 17/02/2022 23:28, Mark Randall wrote: > > > I present: > > > > > > https://wiki.php.net/rfc/undefined_variable_error_promotion > > > > > > It would be good to have a "Scope" or "Unaffected Functionality" sectio= n > > here, because there are a number of closely related things which were > > also raised from Notice to Warning in 8.0: > > > > - undefined array keys > > - undefined object properties > > - array access on a non-array > > - property access on a non-object > > > > I think it is sensible to discuss those separately, but it would be goo= d > > to make that clear. > > > > > > Similarly, it would be good to have more discussion of what "accessing" > > means, as the current examples are quite narrow, only showing direct us= e > > and the ++ operator. Other functionality potentially affected: > > > > - passing the variable to a function, presumably excluding by-reference > > parameters which don't currently warn > > - all the combined assignment operators - > > https://www.php.net/manual/en/language.operators.assignment.php > > - the array append operator ($a[] =3D 42;) does NOT currently give an > > undefined variable Warning > > - variable variables, e.g. "$b =3D 'a'; echo $$b;" > > - the compact() pseudo-function > > > > There's probably others that I've missed. > > > > I 100% agree with that. An "Unaffected Functionality" section would be mu= ch > welcome. > > I would add to the list: isset($foo) when $foo is first seen. > (To me this should not throw anything, like for uninitialized properties.= ) > > If the RFC is about promoting the current warnings to Error without addin= g > any other Error at places that currently don't throw any warnings, then i= t > could be useful to say so. And if the RFC is going to propose to throw > Error at places that are currently warning-less, the list should be > explicit. > > I very much call for an implementation to be provided before starting any > vote on the topic btw. > This is typically the kind of topic where getting into the actual code > might help spot edge cases. > > Thanks for the RFC btw! > > Nicolas > --000000000000d6b19205d89a734f--