3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('one', 'two', 'three', 'four', 'stop', 'five'); while (list(, $val) = each($arr)) { if ($val == 'stop') { break; /* You could also write 'break 1;' here. */ } echo "$val<br />\n"; } /* Using the optional argument. */ $i = 0; while (++$i) { switch ($i) { case 5: echo "At 5<br />\n"; break 1; /* Exit only the switch. */ case 10: echo "At 10; quitting<br />\n"; break 2; /* Exit the switch and the while. */ default: break; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 16
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/kCjXW
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arr, !1 = $val, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > JMP                                                      ->8
    5     2    >   IS_EQUAL                                                 !1, 'stop'
          3      > JMPZ                                                     ~4, ->5
    6     4    > > JMP                                                      ->14
    8     5    >   NOP                                                      
          6        FAST_CONCAT                                      ~5      !1, '%3Cbr+%2F%3E%0A'
          7        ECHO                                                     ~5
    4     8    >   INIT_FCALL_BY_NAME                                       'each'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $6      
         11        FETCH_LIST_R                                     $7      $6, 1
         12        ASSIGN                                                   !1, $7
         13      > JMPNZ                                                    $6, ->2
   13    14    >   ASSIGN                                                   !2, 0
   14    15      > JMP                                                      ->26
   16    16    >   IS_EQUAL                                                 !2, 5
         17      > JMPNZ                                                    ~10, ->21
   19    18    >   IS_EQUAL                                                 !2, 10
         19      > JMPNZ                                                    ~10, ->23
         20    > > JMP                                                      ->25
   17    21    >   ECHO                                                     'At+5%3Cbr+%2F%3E%0A'
   18    22      > JMP                                                      ->26
   20    23    >   ECHO                                                     'At+10%3B+quitting%3Cbr+%2F%3E%0A'
   21    24      > JMP                                                      ->28
   23    25    > > JMP                                                      ->26
   14    26    >   PRE_INC                                          ~11     !2
         27      > JMPNZ                                                    ~11, ->16
   27    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.9 ms | 1390 KiB | 13 Q