Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47471 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54951 invoked from network); 22 Mar 2010 22:01:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2010 22:01:12 -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.78.25 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.78.25 ey-out-2122.google.com Received: from [74.125.78.25] ([74.125.78.25:58104] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/05-22105-7A8E7AB4 for ; Mon, 22 Mar 2010 17:01:12 -0500 Received: by ey-out-2122.google.com with SMTP id d26so405919eyd.39 for ; Mon, 22 Mar 2010 15:01:09 -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=DQT0MMBSLoh3xsFCwpMUHxSkOTnUid141jLk5FT3j6E=; b=xJduDtNqIa+2+mqdoT/FGcHy7u0PuuGVzgpcyxNvCeqhnsLbtbwyWiYEZ6LSfAyMxQ XkFSa5iviAPadLnMTZeL1LMaajNnU62DhpIcWaeowOk7tTOTtfVjZo8O5vR3bpHElTpF WhyXW/t8bVCdHMJ3cm3fhY+wBXxFQApaSPAfI= 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=kyALIIEDbe/sFpcD5XdOSBXTAV+I+u8Gy2QHkhohsQ/1K7qCyYgWAxAtrwhOUla7vM IUhRKiHgGWs3mUDKyKHEFSwR6b1sI1hmn+hvfbIsB2dy5Pa+8u2ke9GCZTEsSpKkqO93 9wL43ADx0jkgEj/I0E6eEzr2lL4Ne8yrDMn/c= Received: by 10.213.2.79 with SMTP id 15mr334264ebi.59.1269295268821; Mon, 22 Mar 2010 15:01:08 -0700 (PDT) Received: from [192.168.2.15] (d54C6F20D.access.telenet.be [84.198.242.13]) by mx.google.com with ESMTPS id 13sm2520686ewy.5.2010.03.22.15.01.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Mar 2010 15:01:06 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Mon, 22 Mar 2010 23:01:04 +0100 Cc: PHP internals , =?iso-8859-1?Q?Johannes_Schl=FCter?= Content-Transfer-Encoding: quoted-printable Message-ID: <4C492F0D-E503-433A-BE21-E1A42777E4B0@gmail.com> References: <6E76B52E-7543-4F09-A948-A7910513B548@gmail.com> <4BA102F2.1000405@mageekbox.net> <62279C8B-4E50-47DE-B682-EE8152084433@gmail.com> To: Derick Rethans X-Mailer: Apple Mail (2.1077) Subject: Re: [PHP-DEV] array_seek function From: felix.devliegher@gmail.com (Felix De Vliegher) On 17-mrt-2010, at 19:09, Derick Rethans wrote: > 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? 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). Johannes: If we decide on the details, if this something I could commit = in 5.3 or do you rather want me to wait until 5.4? Cheers, Felix=