2023-08-23 8:35 GMT+02:00, chopins xiao <chopins.x...@gmail.com>:
> I use @ instead of #[] as attribute token. attribute use whitespace marks
> are closed. Of course you can start with @@ or #, other.
> error control use @@ instead of @, add T_SILENCE token
>
> new syntax:
> one attribute: @attribute{WHITESPACE} @otherAttribute(12){WHITESPACE}
> group attribute: @attribute1(1, 2),attribute2(343,
> 43)@attibute3(33)[WHITESPACE]
>
> current syntax:
> one attribute: #[attribute()] #[otherAttribute()]
> group attribute: #[attribute1(1, 2),attribute2(343,),attibute3(33)]
>
> below is comparison
> new syntax:
>
> @AttrA@AttrB(112, 334),AttrC
> @AttrD
> class A {
>  @AttrE
>  @AttrF @AttrG
>  public $a;
>  @AttrM
>    public function m1(@AttrParma(1) $c) {}
> }
>
> $ab = @fn(1) fn()=> 1+2;
> -----------
> current syntax:
>
> #[AttrA,AttrB(112, 334),AttrC]
> #[AttrD]
> class A {
>  #[AttrE]
>  #[AttrF]  #[AttrG]
>  public $a;
>  #[AttrM]
>    public function m1(#[AttrParma(1)] $c) {}
> }
> $ab  = #[fn(1)] fn()=>1+2;
>
> my implemented:
> https://github.com/chopins/php-src/tree/new-syntax/attribute
>
>
> Other new syntax implemented (Verification of feasibility) :
> https://github.com/chopins/php-src/blob/php-alternative-syntax/alternative-syntax.md
>
>
> Regards
> Chopin Xiao
>

I think this was debated extensively already. :) It's unlikely to change.

Olle

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

Reply via email to