Re: Re: [RFC] Deprecate dynamic properties

From: Date: Tue, 16 Nov 2021 14:59:34 +0000
Subject: Re: Re: [RFC] Deprecate dynamic properties
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-116414@lists.php.net to get a copy of this message
On Tue, Nov 16, 2021 at 4:23 AM Rowan Tommins <rowan.collins@gmail.com> wrote: > On 16/11/2021 09:27, Andreas Heigl wrote: > > > >> I see, yes, code that is 100% perfectly tested can get away without > >> the language performing any error checking at all - the behaviour is > >> all guaranteed by the tests. I would be very surprised if even 1% of > >> PHP applications can claim such comprehensive tests. > > > > The topic here was that new code can verify the declaration of a > > property by using tests. That does not need to happen on the language > > level. I was never talking about adding tests for existing code. > > > > For most code bases, even new ones being written from scratch in PHP > 8.0, that level of testing simply doesn't exist, and having the language > tell you "hey, you wrote $this->loger instead of $this->logger" is a > useful feature. And, in a lot of cases, more useful than having the > language say "OK, I've created your dynamic $loger property for you", > which is what currently happens. > What you described there sounds like a warning and not a fatal error. Maybe that's where some of the trepidation is coming from. I know I'm less worried about the deprecation notice and more worried about what happens in PHP 9 when it's a fatal error.

« previous php.internals (#116414) next »