Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62296 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60132 invoked from network); 20 Aug 2012 17:42:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2012 17:42:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:55067] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/02-07742-BF672305 for ; Mon, 20 Aug 2012 13:42:19 -0400 Received: from [192.168.0.200] (5ad3285b.bb.sky.com [90.211.40.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 79134758087; Mon, 20 Aug 2012 13:42:14 -0400 (EDT) Message-ID: <503276DB.2010704@ajf.me> Date: Mon, 20 Aug 2012 18:41:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Levi Morrison CC: Herman Radtke , Yasuo Ohgaki , Etienne Kneuss , Rasmus Lerdorf , Rasmus Schultz , internals@lists.php.net References: <502EB667.1020602@lerdorf.com> <50326D11.4090101@ajf.me> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] re: removing an item from an array From: ajf@ajf.me (Andrew Faulds) On 20/08/12 18:27, Levi Morrison wrote: >> 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. -- Andrew Faulds http://ajf.me/