Re: re: removing an item from an array
| From: | Andrew Faulds | Date: | Mon, 20 Aug 2012 17:41:47 +0000 |
| Subject: | Re: re: removing an item from an array | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62296@lists.php.net to get a copy of this message | ||
On 20/08/12 18:27, Levi Morrison wrote:
-- Andrew Faulds http://ajf.me/You are basically asking to alias array_filter with "array_delete". That is a very slippery slope. I think array_filter is a very obvious choice to remove something from an array. The "filter" function/method is common in functional languages (and functional frameworks like Underscore).This about sums up my opinion on deleting things by value on a PHP array. ** Me and Levi had a private email back-and-forth about this. Like many things here, this discussion has become a pseudo-argument, and it's unclear whether people actually think it's a good idea or not. So let's make an RFC (I think array_delete($array, $value, $all=false), mirrors Python's replace-one-only by default), vote on it, and that can decide things. So we can avoid argument. Don't like the syntax? Vote against it, but I don't see how it could be much better.