Re: [RFC] Shorter Attribute Syntax Change RFC 0.2
| From: | Sara Golemon | Date: | Tue, 04 Aug 2020 15:01:40 +0000 |
| Subject: | Re: [RFC] Shorter Attribute Syntax Change RFC 0.2 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111321@lists.php.net to get a copy of this message | ||
On Tue, Aug 4, 2020 at 9:03 AM Benjamin Eberlei <kontakt@beberlei.de> wrote:
> It provides a small BC break where code written as @[$foo, $bar] = baz();
> or $foo = @["bar" => $baz]; will not compile on PHP 8 anymore, but that can
> be easily
> fixed by writing it with a space between @ and [.
>
> If those are the potential breaks we're choosing between, I would favor
#[...] as it provides strong forward-compatibility to drive adoption and
use at the cost of a parse error that's easily fixed (even programmatically
with a very simple script). @[...] provides no forward compat with a
roughly equal chance of easily fixed syntax break.
Given that, the choice seems obvious to me.
Change my mind?
-Sara