Вопрос

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top