Re: The @@ is terrible, are we sure we're OK with it?

From: Date: Thu, 23 Jul 2020 07:37:18 +0000
Subject: Re: The @@ is terrible, are we sure we're OK with it?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-111145@lists.php.net to get a copy of this message
Hi, On 22/07/2020 19:09, tyson andre wrote: > I think that #[ has its own issues, but am open to re-voting on > it. > For example, the following snippet would get parsed differently in PHP 7.4 and PHP 8.0, given a > hypothetical JIT annotation for Opcache. > With <<Opcache\Jit>>, it would give people a clear indication that the file > required PHP 8.0, > but a one-line annotation might be silently treated differently in many subtle ways in 7.4. > It's probably possible to amend the parser make it an error to put the function > declaration on the same line or to have other # comments > within a multi-line #[ annotation, > but I really dislike the special casing it would add. This is pretty much the reason why I didn't go for '#[' as my first choice: the false sense of backwards compatibility that can be easily (and inadvertently) defeated with multiline attributes or inline function definition. Since '@@' is causing such unrest, I'd be happy to revisit my choice and embrace '#[', which was the second option in my vote. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/

« previous php.internals (#111145) next »