note 103257 added to control-structures.foreach
| From: | aram_alipoor2010 at NO_SPAMyaaaaaahoooo dot com | Date: | Mon, 04 Apr 2011 17:58:05 +0000 |
| Subject: | note 103257 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178483@lists.php.net to get a copy of this message | ||
After doing some test i figured it out that this loop:
<?php
$i = sizeOf($array) - 1;
while($i > -1)
{
echo($array[$i]);
$i--;
}
?>
is faster than any other loop for this purpose, even foreach is slower than this loop.
----
Server IP: 69.147.83.197
Probable Submitter: 94.183.172.138
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/103257
Del: integrated -- https://master.php.net/note/delete/103257/integrated
Del: useless -- https://master.php.net/note/delete/103257/useless
Del: bad code -- https://master.php.net/note/delete/103257/bad+code
Del: spam -- https://master.php.net/note/delete/103257/spam
Del: non-english -- https://master.php.net/note/delete/103257/non-english
Del: in docs -- https://master.php.net/note/delete/103257/in+docs
Del: other reasons-- https://master.php.net/note/delete/103257
Reject -- https://master.php.net/note/reject/103257
Search -- https://master.php.net/manage/user-notes.php