From 55713d3fa09bd9702d8fcca5ddc60e5f304bbef7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 4 Jun 2012 13:22:33 +0000 Subject: [PATCH] Fix doc bug #62222: Continue 0; is invalid git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325967 c90b9560-bf6c-de11-be94-00142212c4b1 --- appendices/migration54.xml | 3 ++- language/control-structures/break.xml | 7 +++++++ language/control-structures/continue.xml | 20 +++++++++++--------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/appendices/migration54.xml b/appendices/migration54.xml index dc9df9196a..7a2427748c 100644 --- a/appendices/migration54.xml +++ b/appendices/migration54.xml @@ -91,7 +91,8 @@ The break and continue statements no longer accept variable arguments (e.g., break 1 + foo() * $bar;). - Static arguments still work, such as break 2;. + Static arguments still work, such as break 2;. As a side effect of this change + break 0; and continue 0; are no longer allowed. diff --git a/language/control-structures/break.xml b/language/control-structures/break.xml index e1eeca087a..c1ce80c1ee 100644 --- a/language/control-structures/break.xml +++ b/language/control-structures/break.xml @@ -59,6 +59,13 @@ while (++$i) { + + 5.4.0 + + break 0; is no longer valid. In previous versions it was interpreted + the same as break 1;. + + 5.4.0 diff --git a/language/control-structures/continue.xml b/language/control-structures/continue.xml index 392bd5bd01..99b95ecf46 100644 --- a/language/control-structures/continue.xml +++ b/language/control-structures/continue.xml @@ -20,14 +20,9 @@ continue accepts an optional numeric argument which tells it how many levels of enclosing loops it should skip - to the end of. + to the end of. The default value is 1, thus skipping + to the end of the current loop. - - - continue 0; and continue 1; is the same - as running continue;. - - @@ -44,9 +39,9 @@ $i = 0; while ($i++ < 5) { echo "Outer
\n"; while (1) { - echo " Middle
\n"; + echo "Middle
\n"; while (1) { - echo "  Inner
\n"; + echo "Inner
\n"; continue 3; } echo "This never gets output.
\n"; @@ -114,6 +109,13 @@ for ($i = 0; $i < 5; ++$i) {
+ + 5.4.0 + + continue 0; is no longer valid. In previous versions it was interpreted + the same as continue 1;. + + 5.4.0