Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
do {...} while (false) example assuming WordPress/PHP
function some_function($value) {
do {
if ( some_condition ) {
break;
}
if ( some_other_condition ) {
break;
}
if ( some_further_condition ) {
break;
}
if ( isset($return) ) {
break;
}
... common code ...
} while (false);
return apply_filters('some_filter', $value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.