On 28/06/2016 17:31, Rasmus Schultz wrote:
For another, eager construction means we can filter annotations with
instanceof rather than by class-name, which is much powerful, enabling
you to leverage inheritance - for example, you'd be able to ask
directly for all instances of ValidationAnnotation and get those with
a single call, which is incredibly useful.

Sorry for the extra mail with only one point, but I missed this before. This can be achieved using the fully-qualified class-name by using is_a() or is_subclass_of(). This obviously needs to trigger the autoloader anyway, but can still avoid actually instantiating the class. (And thus, per my other mail, evaluating the args.)

I think lazy construction (without magic stub classes) gives the best of both worlds here.

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

Reply via email to