Re: foreach vs. while(list() = each())

From: Date: Thu, 12 Apr 2001 07:49:52 +0000
Subject: Re: foreach vs. while(list() = each())
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-48262@lists.php.net to get a copy of this message
@ 3:45:39 AM on 4/12/2001, Brian Clark wrote: ... >> You don't need to reset() the array, You also don't need list() and >> each(), which impose additional overhead. You put the array loop to >> the foreach() implementation, which is in C, instead of >> implementing it with PHP with while(), list() and each(). That must >> be a lot faster. D'oh, I need to be asleep. Sorry for shooting blanks. :) Anyway, I was just going to say that I wanted this in PHP3 for a long time (foreach()), then it arrived, and we're still using PHP3 for various reasons (don't ask) and PHP3 doesn't have foreach(). :( <violin> It's quite a sad story. </violin> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies.

« previous php.general (#48262) next »