Le 27/05/2021 à 13:42, Marco Pivetta a écrit :
On Thu, May 27, 2021 at 1:29 PM Pierre <pierre-...@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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to