ID: 26209 Updated by: [EMAIL PROTECTED] Reported By: marrtins at hackers dot lv -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: w2k,sp4 PHP Version: 4.3.3 New Comment:
This have been fixed in CVS. I have added an example of what we shouldn't do when using continue, guess who wrote it ? ;) http://news.php.net/article.php?group=php.doc&article=969356927 Previous Comments: ------------------------------------------------------------------------ [2003-11-12 08:14:06] [EMAIL PROTECTED] >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 ------------------------------------------------------------------------ [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