Question

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..?

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top