Re: [RFC] Reflection annotations reader
| From: | Derick Rethans | Date: | Wed, 09 Jan 2013 12:09:18 +0000 |
| Subject: | Re: [RFC] Reflection annotations reader | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64730@lists.php.net to get a copy of this message | ||
On Tue, 8 Jan 2013, Pierrick Charron wrote:
> On 8 January 2013 03:55, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
>
> > On the contrary, plenty of implementations means there's a need in
> > this functionality, and it might be a good idea to have one standard
> > implementation if it can cover like 80% of use cases.
Good luck with that! I've seen so many different syntaxes for docblock
"annotations" out there that I doubt you can do this.
> I agree, there is a need in this functionality, but all those userland
> implementations were at the first place made because this
> functionality was not part of the language. I think docblocks is not
> the solution, doc blocks are just comments, and I would expect any
> code to work the same way if I remove my comments.
Actually, docblocks are handled by the parser. And whether "annotations"
come in the form of such a docblock with a specific syntax, or without
with a special new syntax outside of docblocks makes no difference at
all.
And really, nobody can convince me that we would need stuff like:
@MyApp\Acl({
"allow"=@MyApp\Acl\Allow({"john"="read",
"joe"="write"}),
"deny"=@OtherApp\Acl\Deny(default="*", log=true)
})
cheers,
Derick