Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47910 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83990 invoked from network); 13 Apr 2010 11:24:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2010 11:24:48 -0000 Authentication-Results: pb1.pair.com header.from=felix.devliegher@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=felix.devliegher@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felix.devliegher@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-ww0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:36212] helo=mail-ww0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/0F-32795-F7454CB4 for ; Tue, 13 Apr 2010 07:24:47 -0400 Received: by wwi14 with SMTP id 14so261016wwi.29 for ; Tue, 13 Apr 2010 04:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=+p8vgZHECyi5lX3LplYwCMwrFRZ1RakHzmryMz3jbzg=; b=w/TU4Q5BLI4gd84Co7SMLebPq6j4LJcqIrHEb+Hu4NPKmkVEj+HPPPRbJo41KEanmg EPGjWQuMoSOSza/d3dj0hZxowL5/NGNdBdSQoPc0MaRLSmOLs7vME7L1NaygUBW/+UeZ meMJqTTuSS0YkDt6BXm8tBmjRxZ1Asi/mId+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=t6JjC7752DUbHvPBzBvHbOXHl/6ohOm0nhiW0Ew7a0JS6LLSA/e6CHlm9GZ9+4xY9S XVNYDBeDjtBrX/5RgsnATKaqHnyezDhsisFbl1MJ/Ldww1FZoUpJLd2JEabnlbIhG3lI 38vHGB1YxmlFDiT3qP8xKNCo+SjMwdgmRWiZU= Received: by 10.216.88.131 with SMTP id a3mr3082279wef.153.1271157884207; Tue, 13 Apr 2010 04:24:44 -0700 (PDT) Received: from [10.0.1.104] (cable-175-208.zeelandnet.nl [82.176.175.208]) by mx.google.com with ESMTPS id u14sm2916269gvf.2.2010.04.13.04.24.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Apr 2010 04:24:42 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Tue, 13 Apr 2010 13:24:40 +0200 Cc: PHP internals , =?iso-8859-1?Q?Johannes_Schl=FCter?= Content-Transfer-Encoding: quoted-printable Message-ID: 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> To: Derick Rethans X-Mailer: Apple Mail (2.1078) Subject: Re: [PHP-DEV] array_seek function From: felix.devliegher@gmail.com (Felix De Vliegher) On 12-apr-2010, at 10:20, Derick Rethans wrote: > On Mon, 22 Mar 2010, Felix De Vliegher wrote: >=20 >> On 17-mrt-2010, at 19:09, Derick Rethans wrote: >>=20 >>> On Wed, 17 Mar 2010, Felix De Vliegher wrote: >>>=20 >>>> On 17-mrt-2010, at 17:52, Derick Rethans wrote: >>>>=20 >>>>> On Wed, 17 Mar 2010, Felix De Vliegher wrote: >>>>>=20 >>>>>> On 17-mrt-2010, at 17:27, Frederic Hardy wrote: >>>>>>>=20 >>>>>>> Why not use arrayIterator::seek() ? >>>>>>=20 >>>>>> Because the functionality isn't exactly the same.=20 >>>>>> ArrayIterator::seek() only sets the array pointer, array_seek = would=20 >>>>>> also return the value + have fseek()-like functionality with the=20= >>>>>> SEEK_* consts and optional negative offsets. >>>>>=20 >>>>> To be honest, I'd rather have the proposed array_seek() return a = status=20 >>>>> whether the seek worked or not. Notices are uncool and you can = already=20 >>>>> retrieve data/key with key() and current().=20 >>>>>=20 >>>>=20 >>>> Update: http://phpbenelux.eu/array_seek-return.patch.txt >>>> I've kept the fseek()-style return values (0 when fine, -1 when = seek fails) >>>=20 >>> Any reason why you picked that over the (IMO more logical) = true/false=20 >>> approach? >>=20 >> No, it makes more sense to use the boolean return values, I was just=20= >> using your fseek() analogy. Although I still find it useful to return=20= >> the seeked value, and false when seek fails (basically how next(),=20 >> reset() and friends behave). >=20 > Has this been added to trunk now? Or not yet? No, still have it lying around. Can I commit this? Cheers, Felix=