Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117112 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75518 invoked from network); 22 Feb 2022 07:55:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Feb 2022 07:55:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6A9891804AC for ; Tue, 22 Feb 2022 01:15:24 -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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 01:15:21 -0800 (PST) Received: by mail-ej1-f44.google.com with SMTP id d10so40813031eje.10 for ; Tue, 22 Feb 2022 01:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HqZG/JjALEQ4tBGnaWICMWXhMT8VqXQCVe+joR6DAEM=; b=B9qOg6ov62O6B077QC5sIqF5B4hPcex20WLPW6M6wwL10x85TPkVwP0d6oS4QqoDBK ibRprUpdNcxqNjZ6RkYGwJ3BcQuIneaM0RaVIAQofGColo3rb+r0ysWLTFVmSHJRZgqn wtrBHsolwhUx6t58haGHOwqYQlB1gOq6cy6YBWzD/J4dXqfy7rJDPN/cZi+RklUy2Zfc R5cR2zRcrdIjH/HXzt/DttlbyZHl4SOp03LFd3cXwZNiuIYlJeVwNdPXBdD4a06e0GGq JzOapRAYHLxK3HziEzQYq7RKxSS4OIpktmtxXhn3ORMqhkv7x5uOsY0OV5u37mQjToqn aaQA== 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=HqZG/JjALEQ4tBGnaWICMWXhMT8VqXQCVe+joR6DAEM=; b=KAyZzp5o5Ao9Rr0aj1TsvmMaNUBbugkhTjVT7vUFqFurcivA25+Cu2lxFb+jmJ4Koo tlQoy4KQICSIL9JSclJGK+uuFBcGI++WIhU8RfVyaurFQwgwquyLl/70NJl//kUC2VgQ pTd7ThUmVfStxtCD0xEsxSlJs0DXvcxxo+aFwZrXX1ABCYCbw8Kt65xh8l0CqF9vvtWG RF5q/LNulusqkWX9cvwUuoLv88uIqJevR1BJl8aVNQjMfbxgrP6qCcTa1Q742cei0o8a q9XkxXaTi+HK9zlxss5oR8xINGYLr4JpH+z+yNxgWXeNQk7stH40Y5SGfltH3kM+PLKq CKKQ== X-Gm-Message-State: AOAM532hVLjnhwwBnbzSoR7wmFjsQILIi47AMD2gBIk3RwYDhJEZfBjV vs/5KG76pGTtS5sshknSJH0woEmejIhcTfwU4dRI7fcN X-Google-Smtp-Source: ABdhPJxiMtgAmTr0rxjNRGlw3aN2vqpjCY+2e/csyaXWU6JDELS53WgF9hl+combsBG+M0WCI7DxhL0GOFPnGAnahzk= X-Received: by 2002:a17:906:a85:b0:6d0:827a:89d0 with SMTP id y5-20020a1709060a8500b006d0827a89d0mr17616020ejf.230.1645521319564; Tue, 22 Feb 2022 01:15:19 -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: <5efecaef-a024-3c61-e12e-ffc342956718@gmail.com> Date: Tue, 22 Feb 2022 10:15:07 +0100 Message-ID: To: Rowan Tommins , Mark Randall Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000b91bb305d897c9d4" Subject: Re: [PHP-DEV] [RFC] Undefined Variable Error Promotion From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000b91bb305d897c9d4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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" section > 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 good > 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 use > 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 much 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 adding any other Error at places that currently don't throw any warnings, then it 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 --000000000000b91bb305d897c9d4--