can I put the break on the same line

Posted by brett on Stack Overflow See other posts from Stack Overflow or by brett
Published on 2010-03-23T10:29:18Z Indexed on 2010/03/23 10:33 UTC
Read the original article Hit count: 130

I have a switch statement that has over 300 case statements.

  case 'hello': 
    { $say = 'some text'; }
        break;

case 'hi':
    { $say = 'some text'; }
        break;

Why is it that the break is always on a separate line? Is this required? Is there anything syntactically incorrect about me doing this:

  case 'hello': { $say = 'some text'; } break;
  case 'hi': { $say = 'some text'; } break;

© Stack Overflow or respective owner

Related posts about php

Related posts about switch-statement