Re: Consensus Gathering: is_initialized

From: Date: Wed, 26 May 2021 10:30:25 +0000
Subject: Re: Consensus Gathering: is_initialized
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-114610@lists.php.net to get a copy of this message
On Wed, May 26, 2021 at 12:14 PM Joe Watkins <krakjoe@php.net> wrote: > Hi internals, > > In response to: https://bugs.php.net/bug.php?id=78480 > > I implemented: https://github.com/php/php-src/pull/7029 > > Not absolutely convinced that it's a good idea, I asked Nikita to review, > and he's unconvinced also and suggested a discussion should be started. > > You can read both of our thoughts about it on the PR. > > What I'm looking for now, is reasons that we are wrong - good use cases > that aren't born from code that is doing bad things ... > > Equally if you think this is really bad even if the reason has already been > mentioned, please make noise. > What's the problem with good 'ol `(new ReflectionProperty(Foo::class, 'bar'))->isInitialized($baz)` ? If it's instantiation time/performance, I'm fairly sure that typical reflection instantiation caching works just fine (and a new API would need a lot of meaningful benchmarks to be warranted). Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

« previous php.internals (#114610) next »