Re: re: removing an item from an array

From: Date: Tue, 21 Aug 2012 14:39:43 +0000
Subject: Re: re: removing an item from an array
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-62344@lists.php.net to get a copy of this message
On Tue, Aug 21, 2012 at 3:36 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > Hi > > 2012/8/21 Tjerk Anne Meesters <datibbaw@php.net>: >> On Tue, Aug 21, 2012 at 10:31 AM, Rasmus Schultz <rasmus@mindplay.dk> wrote: >> >>> Thank you, but this isn't really anything like what I had in mind. >>> >>> What I had in mind is more like set-semantics for arrays, e.g. designed to >>> work with sets of distinct values/objects. >>> >>> Since I do not have permission to write on the wiki, I posted an initial >>> draft here: >>> >>> https://gist.github.com/321ad9b4b8c4e1713488 >> >> >> Just an idea, since array_delete() may remove multiple values, I would >> change the return value to (int) and return how many elements were removed >> from the array. > > Int would be better and callable should be accepted like array_walk(). > It's better to have array_delete_recursive(), too. > I updated the page. > > array_add() needs more discussion. > What we should do with array value, accept callable or not, etc. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > I'm against this RFC, but if you are going to even try to add something, please keep it consistent! Don't modify array_delete to take a callable, instead make a different function array_udelete or something. And keep default $strict values consistent with existing functions that have that parameter.

« previous php.internals (#62344) next »