ID: 33034
Comment by: packard_bell_nec at hotmail dot com
Reported By: sadmac at earthlink dot net
Status: Open
Bug Type: Feature/Change Request
Operating System: Windows XP
PHP Version: 4.3.11
New Comment:
I also like this feature proposal, because it can simplify the coding
VERY much. It can eliminate the repeating checkups, statements, or even
functions. In addition, it can increase the readability.
Previous Comments:
------------------------------------------------------------------------
[2005-05-15 03:35:04] sadmac at earthlink dot net
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33034&edit=1