4 ms·
What comes to mind immediately is that you would lose the ability to `break` unless you had another convention like returning a specific value to indicate you w
by baddox 7y ago
What comes to mind immediately is that you would lose the ability to `break` unless you had another convention like returning a specific value to indicate you want to break.
- lesserknowndan 7y agoIf you are limited to one statement you could still do something along the lines of the following (no particular language): foreach ( $item in $list ) { if ( 1 == some_function( $item ) ) { continue; } else if ( 2 == some_function( $item ) ) { break; } else { another_function( $item ); } } But I would immediately concede that it is starting to miss the entire point of why it was enforced in the first place...