|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-07 12:55 UTC] packard_bell_nec at hotmail dot com
[2015-06-19 13:40 UTC] kalle@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: kalle
[2015-06-19 13:40 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 20:00:01 2025 UTC |
Description: ------------ When the user uses continue in a switch, it behaves essentially the way a break behaves. However, the name might imply (and I already have use for this feature) that the switch statement would then continue evaluating cases, and execute any code under another case statement further down in the switch which fit the condition. Reproduce code: --------------- <?php $j = 0; switch($j) { case 0: echo "part one "; break; case 1: //blah blah blah break; case 0: echo "part two"; break; } //Will only ouput "part one" switch($j) { case 0: echo "part one "; continue; case 1: //blah blah blah continue; case 0: echo "part two"; continue; } //Should potentially output "part one part two" ?> Expected result: ---------------- The first statement should behave as it currently would, the second should evaluate both case 0s, not just the first. Actual result: -------------- Both switches evaluate only the first case 0.