Hi,

On 11/08/2020 12:10, Chris Riley wrote:
> What is the expected behaviour of:
> 
> @[Bar()];
> class Foo {}
> 
> That would appear to be valid code and for the difference of a single ;
> does wildly different things, assuming there is a function Bar defined
> somewhere. (and only by the fact that @ doesn't suppress fatal errors does
> it not cause utter confusion if Bar isn't defined)
I think an 'unexpected token ";"', which is what currently happens if
you do the same with "@@" on current master, would still be an
appropriate behaviour.

FWIW, I haven't made up my mind yet and that's why I haven't cast my
vote yet.

I do agree with Chris here and I somehow mentally parse the above as
"silencing an array containing a function call", which to me is bad
enough to rule the syntax out. I would surely get used to it, if
accepted, but that's how I feel now.

Rust's #[] to me looks better, but I am still bothered by the fact that
it can be used in a backwards compatible way, but not fully so
(multi-line, syntax errors).

And "@@" is super ugly, although I'm not bothered that much by its lack
of ending delimiter, since most of the times longer attributes will
still, albeit just visually, have some in the closing ")".


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

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

Reply via email to