fork(3) download
  1. <?php
  2.  
  3. $n = 7;
  4. for($i = 0; $i < $n; $i++) {
  5. // la fiecare iteratie a lui $i, avem un alt for
  6. echo 'Iteratia #', $i, ': ';
  7. for($j = 0; $j < $n; $j++) {
  8. if( $i == 4 && $j == 4 ) {
  9. break 2; // se aplica la for-ul mare
  10. }
  11. if( $j >= $n - $i ) {
  12. continue 1; // se aplica la for-ul din mijloc
  13. }
  14. print "$j ";
  15. }
  16. print "\n";
  17. }
  18.  
  19. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Iteratia #0: 0 1 2 3 4 5 6 
Iteratia #1: 0 1 2 3 4 5 
Iteratia #2: 0 1 2 3 4 
Iteratia #3: 0 1 2 3 
Iteratia #4: 0 1 2