Bug #1483: parser endless loop within "while () / endwhile"
| From: | jw at de dot uu dot net | Date: | Tue, 01 Jun 1999 19:10:53 +0000 |
| Subject: | Bug #1483: parser endless loop within "while () / endwhile" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6374@lists.php.net to get a copy of this message | ||
From: jw@de.uu.net
Operating system: any (found @ Solaris)
PHP version: 3.0.8
PHP Bug Type: Parser error
Bug description: parser endless loop within "while () / endwhile"
At PHP2 it seemed to be very popular to use "while (expr); ... endwhile;".
Also the usage of "while (expr): ... endwhile;" produced an error:
parse error, expecting
END_TAG' or ';'' or `'{''
on line 8
(Note the different delimiters ';' and ':' after "while ()"
With PHP3 the syntax changed to use ":" as the delimiter
or (more likely) the users coded C syntax: "while (expr) { ... }".
Put the parser misses to detect a falsely used ';' which
causes an endless loop: (at least with PHP 3.0.7 and 3.0.8)
<?
$num=3; $i=0;
while ($i<$num);
Echo "$i, ";
$i++;
endwhile;
?>