Re: [VOTE] Deprecate dynamic properties

From: Date: Mon, 15 Nov 2021 22:31:53 +0000
Subject: Re: [VOTE] Deprecate dynamic properties
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-116395@lists.php.net to get a copy of this message
On Mon, Nov 15, 2021 at 4:40 PM Matthew Brown <matthewmatthew@gmail.com> wrote: > On Fri, 12 Nov 2021 at 08:08, Nikita Popov <nikita.ppv@gmail.com> wrote: > > > Hi internals, > > > > I've opened the vote on > > https://wiki.php.net/rfc/deprecate_dynamic_properties. > > Voting will close > > 2021-11-26. > > > > Regards, > > Nikita > > > > There are two things developers think about when releasing code: > > 1. does it work for me > 2. does it work for everyone else > > With its support for runtime type hints and other similar checks, PHP does > a reasonably good job of aligning those two — what works for me _generally_ > works for everyone else, too. > > Using dynamic properties is one of the areas where "works for me" and > "works for everyone else" can diverge. Some people use static analysis to > keep track of those divergences, but if PHP _can_ warn people they're doing > a probably-dumb thing, I think it should. > > Warning someone is very different than not allowing it > I encourage people to vote "yes" on this, if you want PHP to be better at > preventing people from shooting themselves in the foot. What if I want a language where people can shoot themselves in the foot because the flexibility it offers is what makes it great > I know there are > valid uses for this, but it's nevertheless a surprising feature, and not > one that delights many PHP developers. Why is this surprising? It's been available since classes were introduced to PHP. > Making it attribute-only from 9.0 > onwards seems incredibly sensible. > > Best wishes, > > Matt > -- Chase Peeler chasepeeler@gmail.com

« previous php.internals (#116395) next »