Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56089 invoked from network); 21 Aug 2012 21:46:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2012 21:46:06 -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:49861] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/E9-10139-E9104305 for ; Tue, 21 Aug 2012 17:46:06 -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 AEDF375803F; Tue, 21 Aug 2012 17:46:01 -0400 (EDT) Message-ID: <5034017E.1020002@ajf.me> Date: Tue, 21 Aug 2012 22:45:34 +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: Yasuo Ohgaki , Tjerk Anne Meesters , Rasmus Schultz , internals@lists.php.net References: <5033E0BC.8040507@ajf.me> <5033EAAB.6090502@ajf.me> <5033F1EA.4070701@ajf.me> <5033FD9C.6080106@ajf.me> <5033FF96.5030105@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 21/08/12 22:43, Levi Morrison wrote: > There is a reason to have a callable provided: custom comparison. > Other array functions solve this by providing a `u` alternative: > > `int array_udelete(&$array, $value, bool function($value, $key))` > > Let's not deviate from established array naming conventions. (Yasuo, > I'm looking at you) > > Cheers, > > Levi Morrison Yeah, this looks like a good solution and we have the best of both worlds. We get int array_delete(&$array, $value, $strict=TRUE); and int array_udelete(&$array, $value, $callback=bool function ($value $key)); :) -- Andrew Faulds http://ajf.me/