Do you need break in switch when return is used?
<p>I was wondering if I need to use "break" in "switch" function when "return" is used.</p>

<pre><code>function test($string)
{
  switch($string)
  {
    case 'test1':
      return 'Test 1: ' . $string;
    case 'test2':
      return 'Test 2: ' . $string;
  }
}
</code></pre>

<p>I've tried it, and it works just fine without "break". But I need to know if this is safe. Thank you.</p>
