Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117573 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48938 invoked from network); 22 Apr 2022 18:56:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Apr 2022 18:56:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DAF4518037E for ; Fri, 22 Apr 2022 13:30:46 -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.6 required=5.0 tests=BAYES_50,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-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 ; Fri, 22 Apr 2022 13:30:46 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id e28so2393869wra.8 for ; Fri, 22 Apr 2022 13:30:46 -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=tzix5Kyjb3T2gXhZDzbbZlt1nXyQwwFjLR035u9gLjk=; b=Kkss8krSXJktGS9LBl1w94Ux3ls5KW8K2nYjDYh0PguFNa10shvcuPePeIHaE5fvKg /GIHLvPf+Q6A4R2ZS3yXz/9B2P+A/OEzV7l9yXvcXBP3q47Mv9z1tVXwAsPWugZCHF77 /Y1ZFT5De4eqAqxrZytt13HUH5llnH0PHoXMgBRatFFhniBUAVimfuV2CPqowhDeNbY8 6zJfyvQ0QSYO3D9zjs4/Pw4Unx1VAlQPDIr9fPMhEGXuBZMieZca6E4za0lciCYKwZ0O Skq0VNwjAFYHJBgBnukBZQZYK3kD74WaQpJ7KUtRrfecA7eyyGFmWOekWRZlc0q1H3O8 mYgw== 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=tzix5Kyjb3T2gXhZDzbbZlt1nXyQwwFjLR035u9gLjk=; b=Aks8cUKR5FJ4P2uaNmf6KnUCEZab+VhttazgpWVbh73lMo/TC73vL1JDtNAVSmJIdC OMTOo0619DIAKgm49Cm2tGsVqhAhaPwaY4Q/+y37c8LT3DhYHcnh2d9x/H2Jyg5r4l6v P2bwo4+bs5mKA+jLJGtF4+3iKLBNrrvyA2h9PNpGbM3NheaqNcFvtGtALZ6dCWKU9trv dEtMz7x/frAeon9I8Z+jl3IubuGvc57hun1CSzD/LaehJ6QXGBGGZDuwslz9rkfO1REi VIpb5p19P0UU0qPe408R0od4M/spAMY8JTBUEPHDv3s9lnJvTpuKeBAv49tZwhgiYQvc G3hg== X-Gm-Message-State: AOAM530P3rCdTW0oxpKByVhk5wOQoTTrfSdSW3ZqHHVfPKYRPZi3if6J uO17Rricmp5bV6lG8CyW6vslg0LBCtA= X-Google-Smtp-Source: ABdhPJyLnhGZnBxCUe7riWprwQqy4gqc2rTCLUpauPp5lIGTZBjn0b2qttjaCe+8UOgQXm8qqy9sCQ== X-Received: by 2002:adf:f943:0:b0:203:e832:129 with SMTP id q3-20020adff943000000b00203e8320129mr5105997wrr.626.1650659445090; Fri, 22 Apr 2022 13:30:45 -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 z18-20020a5d6552000000b00207b65f745bsm2444770wrv.83.2022.04.22.13.30.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 13:30:44 -0700 (PDT) Message-ID: Date: Fri, 22 Apr 2022 21:30:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-GB To: internals@lists.php.net References: <6261d073.1c69fb81.a42c.d7cfSMTPIN_ADDED_MISSING@mx.google.com> <6262e219.1c69fb81.f1cd4.6ff5SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <6262e219.1c69fb81.f1cd4.6ff5SMTPIN_ADDED_MISSING@mx.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Undefined Property Error Promotion From: rowan.collins@gmail.com (Rowan Tommins) On 22/04/2022 18:12, Mark Randall wrote: > Accessing an unset property, which currently emits a warning, will > instead throw an Error. > > [...] > > Re: Case 4, an untyped property without its own initializer is > effectively defaulted to null. Imagine you're a new user, learning PHP 9.0, and learning that "public $foo" defaults to null; and if you call unset(), it's deleted from the object, and then accessing it is an error. But then you change it to "public ?string $foo" and it doesn't default to null, even though it's nullable, and accessing it will give you a different error; and calling unset() on that doesn't delete it from the object, but does mean you get an error reading it. Also, there's this non-standard class called "stdClass", which unlike standard classes, you can read and write any property you like without declaring it, and even if you use unset(), you'll never get an error. Do you not have even a little bit of hope that we could make that less confusing, since we're breaking everyone's old code anyway? Regards, -- Rowan Tommins [IMSoP]