It would, but the short array syntax followed by a function/method decl
would be unambiguous.

On dmitry's note, I'm not sure maintaining similarity with Hack is
justified.  While Facebook maintains it as an open source project, they
primarily built it for themselves, so I can only think they will prioritise
their own needs over that of the PHP community.

This make it an unattractive alternative to PHP in my eyes and it may
explain why there are still so few projects on github written in Hack.  I
don't see any reason why PHP should follow in their footsteps when it
concerns syntax.
On 26 Apr 2016 7:33 p.m., "Pierrick Charron" <pierr...@adoy.net> wrote:

> And it will probably be in conflict with the Short Array Syntax ?
>
> On 26 April 2016 at 13:14, Dmitry Stogov <dmi...@zend.com> wrote:
>
>> Just because HHVM is closer to PHP than C#.
>>
>>
>> ________________________________
>> From: Dominic Grostate <codekest...@googlemail.com>
>> Sent: Tuesday, April 26, 2016 19:43
>> To: Dmitry Stogov
>> Cc: rowan.coll...@gmail.com; PHP internals; Stanislav Malyshev
>> Subject: Re: [PHP-DEV] [RFC] PHP Attributes
>>
>>
>> Why not like C#?
>>
>> [Description("My Function")]
>> function my_function()
>> {}
>>
>> Without the semicolon, this wouldn't be valid in any other context.
>>
>> On 26 Apr 2016 8:41 a.m., "Dmitry Stogov" <dmi...@zend.com<mailto:
>> dmi...@zend.com>> wrote:
>>
>>
>> On 04/25/2016 11:20 PM, Stanislav Malyshev wrote:
>> Hi!
>>
>> No, but this is valid:
>>
>> @atrr(); function foo() { ... }
>>
>> That's perhaps a little too close for comfort...?
>> That's different syntax. If you put ; in the middle of statement, it can
>> change - "$c = $a + $b;" is not the same as "$c = $a; + $b;" - but
>> nobody thinks + can not be used because of that. As I said, << and >>
>> are existing operators too, so if you are creative enough, I'm sure you
>> can find cases like that too.
>>
>> Hi Stas,
>>
>> You may try to replace attribute syntax with @attr(...) (without
>> semicolon) into our PHP parser.
>> Note that we have LALR grammar + restrictions caused by semantic actions.
>> If you are able to do this, I'll add it into the RFC as an option.
>>
>> Thanks. Dmitry.
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

Reply via email to