Bug #10653 Updated: loop limiters
| From: | cynic@php.net | Date: | Mon, 07 May 2001 12:47:12 +0000 |
| Subject: | Bug #10653 Updated: loop limiters | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-54206@lists.php.net to get a copy of this message | ||
ID: 10653
Updated by: cynic
Reported By: tboothby@felfel.com
Old-Status: Open
Status: Bogus
Bug Type: Feature/Change Request
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
hm, would you also want while23859() ?
also, would for1000($i=0;$i<count($search);$i++) {...}
loop 1000 times even if $search contained less than 1000 values? plainly, you have this kind of
functionality in any language. in PHP, your examples would look like this:
$i = 0 ;
while( 100 > $i ) {
$i++ ;
$rec = mysql_fetch_row( $res ) ...
}
and
for( $i = 0 ; 1000 > $i && count( $search ) > $i ; $i++ ) ...
Previous Comments:
---------------------------------------------------------------------------
[2001-05-03 17:49:53] tboothby@felfel.com
Looping structures should (IMO) all have a limiting variant.
For example,
while100($rec=mysql_fetch_row($res)) {...}
Would only loop 100 times
for1000($i=0;$i<count($search);$i++) {...}
Would loop 1000 times, etc.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10653&edit=2