Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34792 invoked from network); 19 Aug 2012 00:40:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2012 00:40:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=packrat@nznet.gen.nz; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=packrat@nznet.gen.nz; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nznet.gen.nz from 210.54.141.251 cause and error) X-PHP-List-Original-Sender: packrat@nznet.gen.nz X-Host-Fingerprint: 210.54.141.251 mta04.xtra.co.nz Received: from [210.54.141.251] ([210.54.141.251:54125] helo=mta01.xtra.co.nz) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/35-00850-BD530305 for ; Sat, 18 Aug 2012 20:40:01 -0400 Received: from [127.0.0.1] (really [222.155.173.41]) by mta01.xtra.co.nz with ESMTP id <20120819003952.MAWF19666.mta01.xtra.co.nz@[127.0.0.1]>; Sun, 19 Aug 2012 12:39:52 +1200 Message-ID: <503035CC.2030000@nznet.gen.nz> Date: Sun, 19 Aug 2012 12:39:40 +1200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Andrew Faulds CC: internals References: <502F9E02.1030704@nznet.gen.nz> <50301654.4020609@ajf.me> In-Reply-To: <50301654.4020609@ajf.me> 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: packrat@nznet.gen.nz ("Morgan L. Owens") 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?