title: Should I ever use continue inside a switch statement?
body: <p>I noticed you can indeed use the <code>continue</code> keyword in a switch statement, but on PHP it doesn't do what I expected.</p>
  
  <p>If it fails with PHP, who knows how many other languages it fails too? If I switch between languages a lot, this can be a problem if the code doesn't behave like I expect it to behave.</p>
  
  <p>Should I just avoid using <code>continue</code> in a switch statement then?</p>
  
  <p>PHP (5.2.17) fails:</p>
  
  <pre><code>for($p = 0; $p &lt; 8; $p++){
      switch($p){
          case 5:
              print"($p)";
              continue;
              print"*"; // just for testing...
          break;
          case 6:
              print"($p)";
              continue;
              print"*";
          break;
      }
      print"$p\r\n";
  }
  /*
  Output:
  0
  1
  2
  3
  4
  (5)5
  (6)6
  7
  */
  </code></pre>
  
  <p>C++ seems to work as expected (jumps to end of for loop):</p>
  
  <pre><code>for(int p = 0; p &lt; 8; p++){
      switch(p){
          case 5:
              cout &lt;&lt; "(" &lt;&lt; p &lt;&lt; ")";
              continue;
              cout &lt;&lt; "*"; // just for testing...
          break;
          case 6:
              cout &lt;&lt; "(" &lt;&lt; p &lt;&lt; ")";
              continue;
              cout &lt;&lt; "*";
          break;
      }
      cout &lt;&lt; p &lt;&lt; "\r\n";
  }
  /*
  Output:
  0
  1
  2
  3
  4
  (5)(6)7
  */
  </code></pre>