Re: re: removing an item from an array
| From: | Levi Morrison | Date: | Tue, 21 Aug 2012 22:37:08 +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-62375@lists.php.net to get a copy of this message | ||
> Why did you change the equivalent code?
> array_walk is the best(fast and memory efficient) way
> to delete elements.
>
> This code may be refereed from old PHP users, therefore
> we should write better code.
>
> If you don' t have good reason to do so, please revert
> the change.
The implementation you had may be faster, but that is certainly NOT
what matters as long as both are correct. What matters in the RFC is
clarity. You have already said that too many people don't know about
array_walk, so why would they understand array_delete in terms of
array_walk? Please do not revert the change as what I have written is
more clear.
The reason speed doesn't matter in behavior example is that once it is
implemented in C it will be just as fast as array_walk, perhaps it
will even be faster.