3 ms·
If you are limited to one statement you could still do something along the lines of the following (no particular language): foreach ( $item in $list ) {
by lesserknowndan 7y ago
If 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...