Skip to content

Instantly share code, notes, and snippets.

@ThomazPom
Last active May 20, 2022 17:08
Show Gist options
  • Save ThomazPom/b6a22fb7f0a6ba04b02de856b4e984a7 to your computer and use it in GitHub Desktop.
Save ThomazPom/b6a22fb7f0a6ba04b02de856b4e984a7 to your computer and use it in GitHub Desktop.
<?php
foreach ([1] as $i) if ($condition) { // Breakable if
//some code
$a = "b";
// Le break
break;
// code below will not be executed
}
for ($i=0; $i < 1 ; $i++) if ($condition) {
//some code
$a = "b";
// Le break
break;
// code below will not be executed
}
switch(0){ case 0: if($condition){
//some code
$a = "b";
// Le break
break;
// code below will not be executed
}}
while(!$a&&$a=1) if ($condition) {
//some code
$a = "b";
// Le break
break;
// code below will not be executed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment