Re: cvs: phpdoc /en/reference/filesystem/functions glob.xml

From: Date: Wed, 08 Sep 2004 05:42:50 +0000
Subject: Re: cvs: phpdoc /en/reference/filesystem/functions glob.xml
References: 1 2 3  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969363883@lists.php.net to get a copy of this message
On Tue, 7 Sep 2004, Mehdi Achour wrote: > Derick Rethans wrote: > > >On Tue, 7 Sep 2004, Mehdi Achour wrote: > > > > > > > >>Isn't like count() ? someone told me that it was better to store the > >>count in a variable and use it in the foreach to avoid calling it in > >>every loop. If I'm wrong, feel free to revert my commit ! > > > >No, you should revert it yourself. It doesn't make sense to use this in > >a for() loop, but for foreach it makes no bloody sense to use a temp > >variable. > > So, using count() in a for is bad, but okay in a foreach ? Correct. Why wouldn't it be okay with a foreach()? It's only executed once there. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.doc (#969363883) next »