Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76039 invoked from network); 15 Apr 2010 11:54:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2010 11:54:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.219 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.218.219 mail-bw0-f219.google.com Received: from [209.85.218.219] ([209.85.218.219:36710] helo=mail-bw0-f219.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/20-20494-C6EF6CB4 for ; Thu, 15 Apr 2010 07:54:21 -0400 Received: by bwz19 with SMTP id 19so1194bwz.1 for ; Thu, 15 Apr 2010 04:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=8mzU8nXNsjJGDI2fK3EicsHznoMj6cAt+0eAuj8124I=; b=LPsOpA6+jAjE5nTegAogg+v3fxdUp5J4kdBe95grgkFwSItgYMNwtI9T5XHMfSFFBW RDoIQaS+FpWHcauDL0AbTDGoqmNxLphEcX0FHOvnYAlbfYUcfPTcYCjeBVvmInkWytxH mxWUPwk4F76uV5FpohdCX7upXrCT7uYDtfSws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Wh8beSgIEAQTXQlI/9P1L3hfA+A9q5phQE9Dx9aa3H25pqCceofeqQHR2QLAnhmOhX JXVGwzjhFcA87r/mp+aT9ktTl2ozeVwiiei2qAkPic0ara8DWf42IxgoCfRssw8nMw9s vb0qlIzAs4AMOr7AzT+wVlkcFQAievjjU1wyM= MIME-Version: 1.0 Received: by 10.204.115.199 with HTTP; Thu, 15 Apr 2010 04:46:55 -0700 (PDT) In-Reply-To: References: <6E76B52E-7543-4F09-A948-A7910513B548@gmail.com> <4BA102F2.1000405@mageekbox.net> <62279C8B-4E50-47DE-B682-EE8152084433@gmail.com> <4C492F0D-E503-433A-BE21-E1A42777E4B0@gmail.com> Date: Thu, 15 Apr 2010 12:46:55 +0100 Received: by 10.204.138.219 with SMTP id b27mr788205bku.139.1271332015258; Thu, 15 Apr 2010 04:46:55 -0700 (PDT) Message-ID: To: Derick Rethans Cc: Felix De Vliegher , PHP internals , =?ISO-8859-1?Q?Johannes_Schl=FCter?= Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] array_seek function From: petercowburn@gmail.com (Peter Cowburn) 2010/4/15 Derick Rethans : > On Tue, 13 Apr 2010, Felix De Vliegher wrote: > >> >>>> Update: http://phpbenelux.eu/array_seek-return.patch.txt >> >>>> I've kept the fseek()-style return values (0 when fine, -1 when seek fails) >> >>> >> >>> Any reason why you picked that over the (IMO more logical) true/false >> >>> approach? >> >> >> >> No, it makes more sense to use the boolean return values, I was just >> >> using your fseek() analogy. Although I still find it useful to return >> >> the seeked value, and false when seek fails (basically how next(), >> >> reset() and friends behave). >> > >> > Has this been added to trunk now? Or not yet? >> >> No, still have it lying around. Can I commit this? > > Dunno... did you go with true/false in the end, or returning the value? > I just realize that in the latter case you wouldn't be able to see > whether the seek actually worked, because every value could be a > "correct" value. I'd prefer the true/false thing still because of that. I realise that I'm late to the game here but do have a couple of thoughts. * The function name: this will go hand-in-hand with functions like current(), next(), prev(), key(), reset() rather than the other array_* functions... wouldn't "seek" be more appropriate given its siblings? * The return value: the purpose of the function is to seek, not to get what is at the seeked-to position (right?) so true/false (+ warning?) makes most sense to me. > > Derick > > -- > http://derickrethans.nl | http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >