I've sifted through the RFC for the array shorthand changes which are
quite nice. Something I'm sure has been brought up, but possibly not
recently: shorthand array splice. Has there been any notion to the
introduction of this feature in the future?
The reason I bring this up is it seems that the proposed notation that
uses a colon may eliminate, or complicate the introduction of this in
the future.
Most languages that support this always start with the start index, and
either specify the length of splice, or the last element to splice to.
e.g.:
$array = [0: 'PHP', 1: 'internals', 2: 'mailing list'];
/* Then a possible splice approach: */
$temp = $array[0 : 2];
$temp = $array[0, 2];
Now, this could be I simply don't know the behavior of the new syntax
when used on top of an existing array, (Does $array[0=>'Test]; even do
anything in terms of assignement?)
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php