I think this RFC syntax is outdated. We can remove the whole new syntax and just make everything between <> php code that returns the last statement because of the array short syntax this ends up to be stuff like:
<['foo' => bar']> <['foo' => foo()]> <['foo' => new Foo('bar')]> This would greatly simplify the feature, because then its just PHP code and everybody allready knows that. On Wed, Jan 9, 2013 at 11:53 AM, Clint Priest <cpri...@zerocue.com> wrote: > Just starting a new thread here to discuss true annotations vs a DocBlock > Parser: > > RFC Referenced: > > https://wiki.php.net/rfc/**annotations<https://wiki.php.net/rfc/annotations> > > > On 1/9/2013 2:09 AM, Peter Cowburn wrote: > >> On 9 January 2013 01:08, Rasmus Schultz <ras...@mindplay.dk> wrote: >> >>> I've started working on a new proposal, but I'm getting hung up on the >>> syntax - if we can't use angle brackets anymore, what can we use? >>> Virtually >>> every symbol on a standard US keyword is an operator of some sort, does >>> that mean those are all out of the question? >>> >>> e.g. thinking of concrete possible basic syntax, neither of the following >>> delimiters would work: >>> >>> [Foo('bar')] >>> >> Why would this not work? I'm struggling to think of a place where one >> would want to use an annotation where it could be misinterpreted as an >> array literal. If anything, the visual "conflict" or association with >> the array syntax is a good thing in my book: my brain parses it as an >> array of one or more annotations. >> > I agree here, I think the above, if possible would be best. In my mind > annotations should proabably be limited in scope to class declarations and > thus only before a class keyword, before a property or method declaration. > > In none of those scopes would [ ] be a parsing issue I believe... > > The one case would be at the beginning of a class, but if simply added > something such as: > [:SomeAttribute(xyz,abc),**SomeAttribute2] > > It could never be confused with short array syntax and is still brief. > > -- > -Clint >