Re: [RFC] Simple Annotations
| From: | Rasmus Schultz | Date: | Tue, 28 Jun 2016 18:10:00 +0000 |
| Subject: | Re: [RFC] Simple Annotations | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94313@lists.php.net to get a copy of this message | ||
Thanks, Richard and Rowan - this gives me more to work with!
I will work on a new proposal and ask for more input when I have a
draft ready :-)
On Tue, Jun 28, 2016 at 7:56 PM, Rowan Collins <rowan.collins@gmail.com> wrote:
> 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
>