ID: 10026
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: *General Issues
Assigned To:
Comments:
I can't reproduce this (using code below):
<?php
$c=0;
for($i=0; $i<$c; $i++) {
echo "yes\n";
}
?>
Could you try this one?
And note: If the variable passed to count() is not an array,
it will return 1.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-03-27 11:09:08] [EMAIL PROTECTED]
The code submitted is inside a function that is called recursively and its not exact
copy of the code.
I've also tried to change the for loop to a while loop with the same result.
---------------------------------------------------------------------------
[2001-03-27 11:07:07] [EMAIL PROTECTED]
I have a strange situation;
I have this code :
$c = count($myarray);
echo $c . '<br>';
for ($i=0; $i<$c; $i++) {
code goes here...
}
echo often often output that $c is 0 BUT the for loop ALWAYS execute...
I also have tried to sorrund the for loop with this :
if ($c>0) {
for(...)
}
and it STILL execute if $c==0
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10026&edit=2
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]