Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117349 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55911 invoked from network); 16 Mar 2022 12:02:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2022 12:02:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1A4C4180506 for ; Wed, 16 Mar 2022 06:27:18 -0700 (PDT) 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_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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 (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 16 Mar 2022 06:27:17 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id r6so2996448wrr.2 for ; Wed, 16 Mar 2022 06:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=O4FK0x1P8scCmUUVm88dTnxIIYlfsKwOAZeNYMKOheQ=; b=jLWMGbCGlpXAWbxph/F4asKuIHAHfg8A4rSjnQ+rcaLGtwer1H6e+9Yl86wnH5GJr/ Hlbop7btPyO7RHy/C0oGoyQD2UOseVKgcl7D0vdil9kF7ootmmuYlPVqz2lnSXGK7hTi pBO0KGk+6xuI7kdEUGhSXUWHUL3LZEGaaqUXN+1xpXVuSlTbmwiSKkGFkaBNIyGi+Lni fePCJjLM8mSAy32TLWIiKz9jjhpMb6Bm0EsBeWo/rp4rPCQUARVQWH5vkz8Fb/pNe+sU i3fqiCmhtk5kM0h4yqRg62fPoJIGJoBs6j2vA9/uMxomGaJJx6dUfd5nNHMv7P6wda4H 3tFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=O4FK0x1P8scCmUUVm88dTnxIIYlfsKwOAZeNYMKOheQ=; b=E4NRNbodUETCKu+D5HlZ2FwbnCuB97X7ez1+dkba6BfSWQu1UVcvcX1sTe6WhRw2x3 ZyMEflKDsnTWaq5YY+dYAqjSuHBaj/5Almkai82Qq0hD3LYxQXBgUIbz4hkIZP5dikJ4 ePcXudV+Fm7xpeXc6qm9W+QoSrIqXsXcgLVetPqJXWu8xsvfGXCortQkm2zl27sz8UzF lnaBxU4Bw7Gf/PfN5yNM/Tuw0Kz42fHi/XX4vq6oNEfFoo4aSckxuTFSuok7sx2bhtIY hm4PbjgaJCpK/UHrwXAnXM2YVA4lSYDCfxw7B6fN6dX3T13Ppi7LqcsrkvTmChXOYD/K n+OQ== X-Gm-Message-State: AOAM532zPT3FoZozaew/endwv5C6MFCsWdIpOn/dH/9rqngkG3gE825/ WnhjFEe8TaP1G7PIv6qlHEyeabbNVas= X-Google-Smtp-Source: ABdhPJwKv2Nf98/YSzgLn72gQjlPE83ACd2htQQun0olq9vpl228+VvCa6ptE7EGMgvkz/arR4NSDw== X-Received: by 2002:adf:e604:0:b0:203:d866:f741 with SMTP id p4-20020adfe604000000b00203d866f741mr5441076wrm.391.1647437236322; Wed, 16 Mar 2022 06:27:16 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id m34-20020a05600c3b2200b00380e3225af9sm1814600wms.0.2022.03.16.06.27.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Mar 2022 06:27:15 -0700 (PDT) Message-ID: <34de69fc-3e03-4337-ed3c-76c7330636c9@gmail.com> Date: Wed, 16 Mar 2022 13:27:14 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-GB To: internals@lists.php.net References: <4724184.31r3eYUQgx@come-prox15amd> <37421f61-4e2e-53d3-56d0-022a3c21ed2e@gmx.de> <4f8bad56-267a-9279-1e57-66fd10b8874f@gmail.com> <6230f8bf.1c69fb81.b1e54.162dSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Undefined Variable Error Promotion From: rowan.collins@gmail.com (Rowan Tommins) On 15/03/2022 23:02, Patrick ALLAERT wrote: > This is not far from the reason why I voted "no". > > I am not against the fact this warning becomes an error per se. I am just > not very fan of cherry-picking an individual kind of problem (read: > notice/warning/error/...) and changing it without a more global frame. I have also voted no for similar reasons: the scope of this RFC appears to be "all the places that are convenient", rather than "all the places that are covered by the claimed rationale". I think it is sensible to raise an error for the kind the kind of "undefined foo" that is almost certainly a typo. I think we should be more cautious about the kind that could be lazy but intentional dynamic access. I would have voted Yes to an RFC which defined its scope in such terms. The language does not currently make that distinction consistently, and I don't think we should be planning an error on a basis as vague as "wherever we currently have a warning". For instance, in-place increment is covered, but array append is not: $undefined++; // Warning, planned Error $undefined[] = 1; // completely silent Similarly, variable-variables are covered, even though they are more similar to array keys, which are not: $foo = 'undefined'; $$foo++; // covered by RFC $array = []; $key = 'undefined'; $array[$key]++; // not covered by RFC None of this is even mentioned in the RFC, let alone justified. Regards, -- Rowan Tommins [IMSoP]