Re: Consensus Gathering: is_initialized

From: Date: Thu, 27 May 2021 12:07:55 +0000
Subject: Re: Consensus Gathering: is_initialized
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-114634@lists.php.net to get a copy of this message
Le 27/05/2021 à 13:42, Marco Pivetta a écrit :
On Thu, May 27, 2021 at 1:29 PM Pierre <pierre-php@processus.org> wrote:
why not having it ?
More API, similar-but-not-exactly-like ReflectionProperty#isInitialized() Minimalims should really be valued more :D
I agree and disagree at the same time. I agree because my absolute opinion is the same as yours, but I disagree because my pragmatism is not all about being an idealist, having an is_initialized() could probably allow the compiler to have a specialized opcode, and make this call much much faster than using the reflection in userland (I'm only guessing, but I think it probably would allow that). So, if it's going to be used and abused in those magic APIs we all use daily without thinking about it (let's say, hydrators or serializers, dependency injection containers and all that stuff, and you do maintain some if I recall) and unlock some performance optimizations in there, I'd say go for it. Regards, -- Pierre

« previous php.internals (#114634) next »