3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string="M"; $last=array($strig,$strg,$string,$stg); switch($last) { case 'k': case 'K': echo "k"; break; case 'm': case 'M': echo "k"; break; default: echo "o"; } ?>
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 188) Position 1 = 16, Position 2 = 16, Position 3 = 18, Position 4 = 18, Position 5 = 20, Position 6 = 7
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 18
Branch analysis from position: 18
Branch analysis from position: 16
Branch analysis from position: 16
filename:       /in/sDWjG
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $last, !2 = $strig, !3 = $strg, !4 = $stg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'M'
    3     1        INIT_ARRAY                                       ~6      !2
          2        ADD_ARRAY_ELEMENT                                ~6      !3
          3        ADD_ARRAY_ELEMENT                                ~6      !0
          4        ADD_ARRAY_ELEMENT                                ~6      !4
          5        ASSIGN                                                   !1, ~6
    4     6      > SWITCH_STRING                                            !1, [ 'k':->16, 'K':->16, 'm':->18, 'M':->18, ], ->20
    5     7    >   IS_EQUAL                                                 !1, 'k'
          8      > JMPNZ                                                    ~8, ->16
    6     9    >   IS_EQUAL                                                 !1, 'K'
         10      > JMPNZ                                                    ~8, ->16
    9    11    >   IS_EQUAL                                                 !1, 'm'
         12      > JMPNZ                                                    ~8, ->18
   10    13    >   IS_EQUAL                                                 !1, 'M'
         14      > JMPNZ                                                    ~8, ->18
         15    > > JMP                                                      ->20
    7    16    >   ECHO                                                     'k'
    8    17      > JMP                                                      ->21
   11    18    >   ECHO                                                     'k'
   13    19      > JMP                                                      ->21
   15    20    >   ECHO                                                     'o'
   18    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.18 ms | 1395 KiB | 13 Q