3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is identical to semicolons.php in this gist // except that it uses colons instead of semicolons // for the first two case statements. foreach ([3, 2, 1] as $rank) { $actions = []; switch($rank) { case 3: $actions[] = "Hit all the things"; case 2: $actions[] = "Hit two things"; case 1: $actions[] = "Hit a thing"; break; } var_dump($rank, $actions); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 22
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/mAgW4
function name:  (null)
number of ops:  24
compiled vars:  !0 = $rank, !1 = $actions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > FE_RESET_R                                       $2      <array>, ->22
          1    > > FE_FETCH_R                                               $2, !0, ->22
    6     2    >   ASSIGN                                                   !1, <array>
    8     3        IS_EQUAL                                                 !0, 3
          4      > JMPNZ                                                    ~4, ->10
   10     5    >   IS_EQUAL                                                 !0, 2
          6      > JMPNZ                                                    ~4, ->12
   12     7    >   IS_EQUAL                                                 !0, 1
          8      > JMPNZ                                                    ~4, ->14
          9    > > JMP                                                      ->17
    9    10    >   ASSIGN_DIM                                               !1
         11        OP_DATA                                                  'Hit+all+the+things'
   11    12    >   ASSIGN_DIM                                               !1
         13        OP_DATA                                                  'Hit+two+things'
   13    14    >   ASSIGN_DIM                                               !1
         15        OP_DATA                                                  'Hit+a+thing'
   14    16      > JMP                                                      ->17
   16    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
    5    21      > JMP                                                      ->1
         22    >   FE_FREE                                                  $2
   17    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.71 ms | 1388 KiB | 15 Q