Hi,

2012/8/16 Rasmus Schultz <ras...@mindplay.dk>:
> How come there is no straight-foward obvious way to simply remove a given
> value from an array?
>
> Just look at the number of horrible ways people solve this obvious problem:
>
> http://stackoverflow.com/questions/7225070/php-array-delete-by-value-not-key
>
> Shouldn't we have something simple, like:
>
>     array_remove($array, $value) : array (returns a new array)
>
> and/or
>
>     array_delete(&$array, $value) : bool (modifies array directly)
>
> ?

It was amazing that this thread has close to 90 mails.

I've added some use cases of array_udelete() to wiki, since
some people fails to see how it could be useful. I also bring
back to array_walk() version of equivalent example. I just
don't see any reason why we should replace it with slower
foreach() version.

I think the RFC page is almost complete.

https://wiki.php.net/rfc/array_delete

Any more comments?

--
Yasuo Ohgaki
yohg...@ohgaki.net

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

Reply via email to