Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74771 invoked from network); 17 Mar 2010 18:09:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2010 18:09:39 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:42610] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/30-07776-1EA11AB4 for ; Wed, 17 Mar 2010 13:09:39 -0500 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 54499E203C; Wed, 17 Mar 2010 18:09:33 +0000 (UTC) Date: Wed, 17 Mar 2010 18:09:33 +0000 (GMT) X-X-Sender: derick@kossu.derickrethans.nl To: Felix De Vliegher cc: Frederic Hardy , PHP internals In-Reply-To: Message-ID: References: <6E76B52E-7543-4F09-A948-A7910513B548@gmail.com> <4BA102F2.1000405@mageekbox.net> <62279C8B-4E50-47DE-B682-EE8152084433@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] array_seek function From: derick@php.net (Derick Rethans) On Wed, 17 Mar 2010, Felix De Vliegher wrote: > On 17-mrt-2010, at 17:52, Derick Rethans wrote: > > > On Wed, 17 Mar 2010, Felix De Vliegher wrote: > > > >> On 17-mrt-2010, at 17:27, Frederic Hardy wrote: > >>> > >>> Why not use arrayIterator::seek() ? > >> > >> Because the functionality isn't exactly the same. > >> ArrayIterator::seek() only sets the array pointer, array_seek would > >> also return the value + have fseek()-like functionality with the > >> SEEK_* consts and optional negative offsets. > > > > To be honest, I'd rather have the proposed array_seek() return a status > > whether the seek worked or not. Notices are uncool and you can already > > retrieve data/key with key() and current(). > > > > 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? with kind regards, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug