From 16389a7b31069481d6c8c0705172bee5ef1ddf5f Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Sat, 12 Aug 2023 21:53:52 +0400 Subject: [PATCH] Rework the examples for continue (#2367) Co-authored-by: Kamil Tekiela --- language/control-structures/continue.xml | 50 ++++++++++++++++++++---- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/language/control-structures/continue.xml b/language/control-structures/continue.xml index cfbb68bc1fa5..0635a484b60c 100644 --- a/language/control-structures/continue.xml +++ b/language/control-structures/continue.xml @@ -33,29 +33,63 @@ $value) { - if (!($key % 2)) { // skip even members + if (0 === ($key % 2)) { // skip members with even key continue; } - do_something_odd($value); + echo $value . "\n"; } - +?> +]]> + + &examples.outputs; + + + + +\n"; + 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"; + echo "This never gets output.\n"; } - echo "Neither does this.
\n"; + echo "Neither does this.\n"; } ?> ]]>
+ &examples.outputs; + + +