1

Can anybody tell whats the default argument value for break in control structures instead of break 1 , break 2 ,..
Example :-

for($i=0;$i<10;$i++){  
   for($j=0;$j<$i;$j++){
      if($j == 4){
          break;
      }else{
          echo $i+$j."<p>";
      }
   }
}

In the above example i used break without arguments.Then which value it will take for that..?

JJJ
  • 32,902
  • 20
  • 89
  • 102
Vinu
  • 167
  • 4
  • 14

1 Answers1

2

The default argument value for break is 1 (ie. innermost control structure). See also: http://php.net/manual/en/control-structures.break.php

Ilmo Euro
  • 4,925
  • 1
  • 27
  • 29