Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47318 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63560 invoked from network); 16 Mar 2010 16:22:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2010 16:22:36 -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:50100] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/88-15129-B40BF9B4 for ; Tue, 16 Mar 2010 11:22:35 -0500 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 7F60FE202E; Tue, 16 Mar 2010 16:22:32 +0000 (UTC) Date: Tue, 16 Mar 2010 16:22:32 +0000 (GMT) X-X-Sender: derick@kossu.derickrethans.nl To: Felix De Vliegher cc: Pierre Joye , PHP internals In-Reply-To: <5F51BD77-EE03-46BB-A73F-802B4A8A2034@gmail.com> Message-ID: References: <6E76B52E-7543-4F09-A948-A7910513B548@gmail.com> <1E2D6F10-F23D-4F08-BFFD-13D5E6CF6D51@gmail.com> <5F51BD77-EE03-46BB-A73F-802B4A8A2034@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 Tue, 16 Mar 2010, Felix De Vliegher wrote: > On 16-mrt-2010, at 17:07, Derick Rethans wrote: > > > On Tue, 16 Mar 2010, Felix De Vliegher wrote: > > > >> Right now, it returns the value of a given position. In that case, > >> array_get_pos might be a better name. Oh, and I attached the patch > >> with .txt extension :) > > > > Does it also seek the array pointer? Because I think array_seek that > > moves the pointer, in combination with current() and key() might make > > slightly more sense? > > Mikko updated the patch a bit to set the array pointer correctly (and > make it perform a bit better when dealing with large arrays), my > version left it one position too far. So yes, that's possible. The > updated version can be found here: > http://valokuva.org/~mikko/array_seek.patch.txt I was also thinking, can we just make this work just like fseek (with a "whence" parameter) as well? (http://uk3.php.net/fseek) with kind regards, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug