note 9092 deleted from function.strlen by dams
| From: | dams@php.net | Date: | Sat, 27 Jul 2002 16:22:58 +0000 |
| Subject: | note 9092 deleted from function.strlen by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33670@lists.php.net to get a copy of this message | ||
To php.net@pinguin.conetix.de:
what you describe is not a bug; it's common behaviour in any programming language.
In a line like:
while($c=$s[$tmp++]) { echo $c; }
the while does not fail automatically, because FIRST the condition needs to be evaluated. This
can't be done, though, because your condition (being a statement at the same time) is not
executable for obvious reasons - therefore the interpreter never reaches the point where he could
end the while loop.
Imagine it as if you wrote it something like this and you'll see why it could never work:
$c=$s[$tmp++];
while($c)
{
echo $c;
$c=$s[$tmp++];
}