Re: re: removing an item from an array

From: Date: Sun, 19 Aug 2012 00:43:19 +0000
Subject: Re: re: removing an item from an array
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-62252@lists.php.net to get a copy of this message
On 19/08/12 01:39, Morgan L. Owens wrote:
On 2012-08-19 10:25, Andrew Faulds wrote:
On 18/08/12 14:52, Morgan L. Owens wrote:
How simple is it? Does it: 1) Remove one occurrence of the element (presumably the first) or all? 2) Reindex the array (as someone else argued was necessary to make it "properly indexed" afterwards) or not? 3) Modify the array in-place or return a modified array? 4) Use type-strict or normal comparisons?
So to answer you, 1) one, 2), no, 3) in-place, 4) type-strict (I don't see how a weakly-typed comparison for identifying an array value would help anyone).
So ... using a different definition of "value" than that used by array_search() and array_keys(), then? Assuming you mean the strictness of comparison, you could have an optional $strict parameter defaulting to false like array_search(). (and hence non-strict by default)
-- Andrew Faulds http://ajf.me/

« previous php.internals (#62252) next »