Re: Wired constant expression syntax and bug
| From: | Dmitry Stogov | Date: | Mon, 30 Jun 2014 19:40:27 +0000 |
| Subject: | Re: Wired constant expression syntax and bug | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75152@lists.php.net to get a copy of this message | ||
at least we didn't have a single test for this new syntax.
Me and probably many others just didn't know about it.
I just noticed Xinchen's commit, that fixed related bug.
May be it's safe, may be not. I cant be sure.
Thanks. Dmitry.
On Mon, Jun 30, 2014 at 11:17 PM, Alexey Zakhlestin <indeyets@gmail.com>
wrote:
>
> On 30 Jun 2014, at 23:06, Dmitry Stogov <dmitry@zend.com> wrote:
>
> > I'm wondered why you introduced this wired syntax in PHP-5.6.
> >
> > class FooBar {
> > const bar = ["bar" => 3]["bar"];
> > }
> >
> > It wasn't a part of RFC, it wasn't covered by tests, and it actually
> > doesn't make a lot of sense. May be it's better to remove it?
>
> Does it harm?
>
> This example doesn’t make much sense, but intention of such code is
> unambiguous. It is clear what should happen.
> So, I’m +0 to leave it if tests are written.
>
> --
> Alexey Zakhlestin
> CTO at Grids.by/you
> https://github.com/indeyets
> PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc
>
>
>
>