Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36142 invoked from network); 19 Aug 2012 00:43:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2012 00:43:51 -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:42632] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/85-00850-6C630305 for ; Sat, 18 Aug 2012 20:43:51 -0400 Received: from [192.168.0.200] (5ad4bfa0.bb.sky.com [90.212.191.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 4E20E7580A2; Sat, 18 Aug 2012 20:43:47 -0400 (EDT) Message-ID: <503036A7.3020809@ajf.me> Date: Sun, 19 Aug 2012 01:43:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: "Morgan L. Owens" CC: internals References: <502F9E02.1030704@nznet.gen.nz> <50301654.4020609@ajf.me> <503035CC.2030000@nznet.gen.nz> In-Reply-To: <503035CC.2030000@nznet.gen.nz> 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 19/08/12 01:39, Morgan L. Owens wrote: > On 2012-08-19 10:25, Andrew Faulds wrote: >> On 18/08/12 14:52, Morgan L. Owens wrote: >>> How simple is it? Does it: >>> >>> 1) Remove one occurrence of the element (presumably the first) or all? >>> 2) Reindex the array (as someone else argued was necessary to make it >>> "properly indexed" afterwards) or not? >>> 3) Modify the array in-place or return a modified array? >>> 4) Use type-strict or normal comparisons? >> >> So to answer you, 1) one, 2), no, 3) in-place, 4) type-strict (I don't >> see how a weakly-typed comparison for identifying an array value would >> help anyone). > So ... using a different definition of "value" than that used by > array_search() and array_keys(), then? > Assuming you mean the strictness of comparison, you could have an optional $strict parameter defaulting to false like array_search(). (and hence non-strict by default) -- Andrew Faulds http://ajf.me/