Re: Array dereferencing using alternative array syntax

From: Date: Mon, 10 Oct 2011 09:55:48 +0000
Subject: Re: Array dereferencing using alternative array syntax
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-55772@lists.php.net to get a copy of this message
On Mon, Oct 10, 2011 at 11:03 AM, Ferenc Kovacs <tyra3l@gmail.com> wrote: > the alternate syntax has a rough past (if I remember correctly, [] was > mentioned to be deprecated, then with 5.3 the preference was switched: > [] is the preferred way now, and {} got almost deprecated), so if we > plan to support the {} syntax on long term, I'm +1 for adding this to > the language. > I we plan to remove it eventually, then imo it is better to not > introduce the support for the alternative syntax. Imho it should be supported regardless of whether we want to remove it or not - for the sake of consistency. I'm all for getting rid of the alternative syntax (especially because it gets more and more convoluted as the language evolves: you might still understand $str{1}, but func(){1} looks more like some strange lambda than a string offset access), but I think that for the several years that we will definitely still support the alternative syntax (as removal of features in PHP usually takes decades) it should be supported fully. Nikita

« previous php.internals (#55772) next »