Re: re: removing an item from an array
| From: | Yasuo Ohgaki | Date: | Tue, 21 Aug 2012 22:20:32 +0000 |
| Subject: | Re: re: removing an item from an array | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62373@lists.php.net to get a copy of this message | ||
Hi,
2012/8/22 Levi Morrison <morrison.levi@gmail.com>:
> On Tue, Aug 21, 2012 at 4:13 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>> Hi,
>>
>> I see why with new Criticism section in the wiki page.
>> You've also misunderstood that array_udelete() is
>> array_walk() variant, not array_filter().
>>
>
> Actually, array_udelete is far more similar to array_filter than it is
> array_walk. . .
Have you read my posts in this thread?
Array filter CREATES new array instead of deleting elements.
If one would like to DELETE element(s) by element value,
array_walk is the way to go.
I suppose I don't have to explain memory and execution
efficiency here. Many people misunderstand the best practice.
This is the reason why I think there should be array_udelete.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net