On Mon, Apr 25, 2016 at 7:11 PM, Rowan Collins <rowan.coll...@gmail.com>
wrote:

> guilhermebla...@gmail.com wrote on 25/04/2016 15:22:
>
>> Another thing that looks odd to me i that every time you call new
>> ReflectionClass, a new reflection_object gets created.
>> Isn't there a way to get this "cached" somehow in zend_class_entry?
>>
>
> I recently came upon a package that exists solely to work around this:
> https://packagist.org/packages/fsi/reflection
>
> I am reminded of the fact that people often say "reflection is slow, use
> it with care". Is this still the case? Does this limit the usability of
> attributes as proposed?


No its not slow, if you don't create Reflection* instances all the time. In
Doctrine we cache this per class and only do it once.

Guilherme came up with the why the object references are not reused on IRC,
because setAccessible could otherwise produce side effects to other
instances. So this actually makes sense.

>
>
> Regards,
> --
> Rowan Collins
> [IMSoP]
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to