Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117602 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85628 invoked from network); 25 Apr 2022 15:16:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2022 15:16:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1DF18180384 for ; Mon, 25 Apr 2022 09:51:40 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 ; Mon, 25 Apr 2022 09:51:39 -0700 (PDT) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-2f7c57ee6feso60278437b3.2 for ; Mon, 25 Apr 2022 09:51:39 -0700 (PDT) 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=H7u/e74fypgYNc1lzLAKnPYbq8TyB2KBww+TP/qygrc=; b=HE5rk2MlR16pnv9br33RNk6L/xwQJLcKMbLM71XdW/wqdBEgulr9DNidSjtG2SgnzU 4r9L0xCdpXAajd6KI7j9foah3gXcjaHD7wCZmc1gzDmTRa1h5ACkPgXXV6uReNU0kgFD zhiCrcrUwdCD83kI2/X/2PzL40+jjJauNc2/O/zhisfGgnTB1AT0cYJcGXv9xPRNUj+l esQV1eneXi1qIQJAwrjV7eV/3I1lSPV+Um+OYXZslAwfwaz5Vu996rb/qznksyUSdiTF 1//GW/dWmgWNbMAz+b2YaQI6IAIf2ocSXOgJ9Xd3YapZawUzE3iZlptqAqY6AzyIRaIF Yx3g== 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=H7u/e74fypgYNc1lzLAKnPYbq8TyB2KBww+TP/qygrc=; b=8Rug+MmSxFX0gQEmXQzrEk1sAKi5P8+M9whm/hP8onP2TAE6bo63iZSwcPklUg+caV NF1ULuWS9XFLwwqFZaROYJRDZq9YW/dEoTlWjQIyEyyT8DaVnmHxELfaTIrlEBczgX+p g7ZyLp/8J2gR2pSeoBlmguSr91gbFeXIW+aoL7KjCPh2moGPVejOtEKZkU9NSgMtOSi7 wdUQmGYAg4oAVaReDMWKBnaY87sMFigu6ZTuDFCgxr3DaJIyiVbFiFacrZOmmLLyCuCk pHg7ThsQqDfdPMakY5UTS1JE1fEzRbMkk0ZiwCG929JC6Xh97XTS7ud64GMGF84Lf6et 6HTw== X-Gm-Message-State: AOAM531pdzpQV2aaLMsf11pHlaXUGgvvLkmnXDUml4kejPon0LDco9LA hoZORcyKPpmGcXriISP4uJgtDoEhyatRvbGelw== X-Google-Smtp-Source: ABdhPJyPhA70k7KiOePaR9w8cKDQ3pZOZ72OapsuB4Bvaae+LHe/Cdz7DreNcKaPjbp/nfe/PDQQdlAr1BLgUbNveKQ= X-Received: by 2002:a81:1dd1:0:b0:2ea:c38b:65a8 with SMTP id d200-20020a811dd1000000b002eac38b65a8mr17500585ywd.135.1650905498964; Mon, 25 Apr 2022 09:51:38 -0700 (PDT) MIME-Version: 1.0 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> <2fcee325-9ac1-8ad4-f55b-a0627c53a445@gmail.com> <2bf2433e-2a4d-7523-7633-0e67a22a0c26@gmail.com> In-Reply-To: <2bf2433e-2a4d-7523-7633-0e67a22a0c26@gmail.com> Date: Mon, 25 Apr 2022 18:51:28 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000d2d58f05dd7d63ca" Subject: Re: [PHP-DEV] [VOTE] Undefined Property Error Promotion From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000d2d58f05dd7d63ca Content-Type: text/plain; charset="UTF-8" > > Are you proposing to deprecate the implicit `= null` default initializer > > for untyped properties? > > Yes. > > > > Thanks for the recap. For untyped properties, that's the historical > > behavior. For typed properties, that's explained in > > > https://wiki.php.net/rfc/typed_properties_v2#uninitialized_and_unset_properties > > *. What's the issue? > > The issue is that for new users, saying "that's the historical > behaviour, you just have to learn it" is not very helpful. > > > > * "If a typed property is `unset()`, then it returns to the uninitialized > > state. While we would love to remove support for the unsetting of > > properties, this functionality is currently used for lazy initialization > by > > Doctrine, in combination with the functionality described in the > following > > section." > > I think both you and Mark misunderstood my point in bringing this up - > I'm not complaining about the ability to call unset(), I'm complaining > that it behaves differently depending how the property was declared. > > Look at how the untyped property behaves in this example: > https://3v4l.org/nClNs The property disappears from var_dump(), but is > not actually deleted from the object, as seen by it still being private > when assigned a new value. Given that we have the magic "uninitialized" > state, and we're proposing to make reading an unset property an error, > it would make more sense for it to show as '["untyped":"Foo":private] => > uninitialized(mixed)' > Understood (also https://3v4l.org/DgXJl ). Maybe start a new thread? (this one is not shown on externals.io, only findable via search) -- Guilliam Xavier --000000000000d2d58f05dd7d63ca--