ID: 26209
Updated by: [EMAIL PROTECTED]
Reported By: marrtins at hackers dot lv
Status: Open
Bug Type: Documentation problem
Operating System: w2k,sp4
PHP Version: 4.3.3
New Comment:
>From the documentation :
"continue accepts an optional numeric argument which tells it how many
levels of enclosing loops it should skip to the end of."
and we see that :
var_dump(print "$r\n"); // int(1)
you see your problem here ? Anyway, the documentation should have a
warning to avoid confusion.
didou
Previous Comments:
------------------------------------------------------------------------
[2003-11-11 16:23:52] marrtins at hackers dot lv
Description:
------------
strnge things happen (at least undocumented) with continue control
structure when using continue with and w/o semicolon
in example below continue w/o semi reproduces 2
with semi as expected 0,1,3 and 4
Reproduce code:
---------------
<?
for($r = 0; $r < 5; ++$r) {
if($r == 2)
continue
print "$r\n";
}
?>
Expected result:
----------------
0
1
3
4
Actual result:
--------------
2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26209&edit=1