Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117575 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52830 invoked from network); 22 Apr 2022 19:33:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Apr 2022 19:33:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 20C2D180380 for ; Fri, 22 Apr 2022 14:08:13 -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-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 14:08:12 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id o20-20020a05600c511400b0038ebbbb2ad8so6051415wms.0 for ; Fri, 22 Apr 2022 14:08:12 -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=p09dm/8f7GDUW/fesaCR2xTFMAX16Khz7Fz9OCUMtUI=; b=YqJrnuOoZHB3e4Jl1N9UzfURLngD9P7RrLp5oKuIOe40dvfXRDyYhF/lS1NfdK5IsO HqM5hhjJFNwpcpvtTsm4KmRAd+xtmh1D5OqBaCjE+gY1riXiNvMuKkXw5HHIDinSWjdD jM8UEqoEmWXiSnPeidzPiZu1MNTPA5uXRxTX0Z+mLrQNwZ3/L6/LoUDlSZECJ0D9DIX3 zds4SKTMWvQNvWTFtf1sGwB6nbf3yos8dFnh9bCU7CMWAXDkTdfxvoffUSD3p0SyA3yF 4wCVYEk5AHQkbSPuV+sFWHsWUsjyjZ1nvbZAbmlfmyd86zEsive00rvAvgNFrgqcpb/3 brKA== 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=p09dm/8f7GDUW/fesaCR2xTFMAX16Khz7Fz9OCUMtUI=; b=G17eXmSFnRaw9L1OzhfwrG08pAsXqXBCseRhqbCkDQrEHU2d6P+pe13pFqEGLFNP2h h5oOJx24KWSNoWkw2l3+d7YO6yHc+lGTy2UlbFq1rfsTRshUCs8zDwGjqyN9x2P+Ed1b WW2VR6IvxnkkRPB61OD+HXR2phe4TxQx82cW8mYXpvPHgLFjZgzrboae+WWhPzqeO2d3 HpsqkaWileTrgyiLuraVoG5Ua7gamanftejYFCtBoB+f5jswnwLpwAHFYxOY4AQ3t/Wq lmB9DkvGhJOGbuQOasKRwv5jPLWPLPrzLp7bF34Zbh9MtX5PobweAzWttFQpRNfMJTb1 TyGA== X-Gm-Message-State: AOAM531zYsO7djVYBs8axQ7eQR15gNfVg7Y3BvBqHfVvaQPfGk/pjCRU E5+TektidrI6wMCJwY93Bw7gME08RQg= X-Google-Smtp-Source: ABdhPJzu73DbRLFNS/issAnq5RkuS9kJ03YqpMMuhXw6SkQk6rFOkUd2Kguan4zktSZ9RyucOQVnGg== X-Received: by 2002:a1c:7703:0:b0:38e:bd95:373c with SMTP id t3-20020a1c7703000000b0038ebd95373cmr14399288wmi.122.1650661691267; Fri, 22 Apr 2022 14:08:11 -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 n4-20020a1ca404000000b00392965e41d6sm5392998wme.39.2022.04.22.14.08.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 14:08:10 -0700 (PDT) Message-ID: <2fcee325-9ac1-8ad4-f55b-a0627c53a445@gmail.com> Date: Fri, 22 Apr 2022 22:08:06 +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> <6263147d.1c69fb81.c372a.2e76SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <6263147d.1c69fb81.c372a.2e76SMTPIN_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 21:47, Mark Randall wrote: > The rule that anything typed must be initialized, nullable or not, is > clearish enough. It's "clear" in the sense of "it can be described in one sentence". It's not at all "clear" in the sense of "makes any logical sense whatsoever". > You could special case nullable, but then it's an extra rule to learn > beyond "typed = needs to be initialized". I'm more inclined to the opposite: if reading an "undefined" property is going to be an error, maybe reading an "uninitialized" one should be too, even if you don't declare a type for it. And maybe we should think about exactly what unset() means, and which error you're going to get after you use it - is the property "undefined" or "uninitialized"? Currently, an untyped property becomes "undefined", as though it never existed; but a typed property is still on the object, but "uninitialized". Yet either way, assigning a new value brings back the declared property, not a dynamic one with the same name: https://3v4l.org/nClNs Regards, -- Rowan Tommins [IMSoP]