Sorry for creating more "noise"...

Am 18.08.2012 06:59, schrieb Sherif Ramadan:
Further more, your assumption here that the result is incorrect (or
improperly indexed) is completely baseless and moot. You are making a
bold assumption that I both care about the keys and that I expect them
to be numeric and sequential (why can't I have string keys?). This
would also entail that I depend on keys for order (which is not a
requirement for a PHP Array since all PHP Arrays are
ordered-hashmaps).

I don't assume anything. I only stated a use-case where unset() will not work. I neatly listed some solutions and pointed out their merits...mostly to show that there are less than ideal solutions out there that will either perform badly or worse, not work properly at all.

The order of the elements in the array has not been affected by the
keys that index them or the use of unset() in the least. So your
argument holds no merit. If you are depending on the sequence of the
keys to determine the order of your elements you made a huge mistake,
because the array was already designed to store elements in order
regardless of whether you provide a key or not. So you're solving the
wrong problem here.

Rest assured, I do know how PHP arrays work. I don't see what the ordering has to do with wanting to keep an array sequentially-indexed.

I never said it was redundant or fussy.
I am going to stop here, for the sake of noiselessness.


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to