Stas Malyshev wrote:
>The idea was originally proposed by Marc Easen who created a patch
>and asked for help with putting together an RFC. I have yet to see a
>formal proposal but on the list Easen modified his idea so that it
>should apply to strings alone. With that in mind, would it really
>cause problems to have code like this:
>
>$string = "Roses are red"; $string[-3] = "R"; // modifying
>$string[10] echo $string; // Roses are Red
I see how this may work for strings and simple vectors, but what about this:
$a = array(-1 => "foo", -2 => "bar"); echo $a[-1];
It should keep returning "foo", right? So then the question is - what
$array[-1] actually means? Right now I'm not sure I understand it. I
guess if somebody wrote an RFC on that it'd make understanding it
easier. I see that the patch seems to address just the string part - but
the subject also mentions arrays. I think making it clear would be helpful.
Stanislav I though that the discussion on adding this type of functionality to
strings was already a done deal? Despite the obvious problems it introduces.
If it's not a done deal, then while I can understand why people thing they like
the idea, the clash with other uses of what looks like identical functionality
are good enough reason not to carry it forward.
I've already pointed out why there is no way that this can be discussed in
connection with 'collection arrays' and so there does need to be a clean break
between the two for ANY discussion. I believe that PHP is the only language that
allows us to use -ve indices ( i.e. keys ) in arrays? That was one of the nice
things about PHP when I moved over to it from C and pascal. Introducing two
different styles of working with 'indices' even though they apply to different
types of object does now seem to be adding to the difficult of educating new
users as to why PHP arrays are NOT the same as other array types they may have
used?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php