3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string="M"; $last=array($strig,$strg,$string,$stg); echo $last; 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 = 17, Position 2 = 17, Position 3 = 19, Position 4 = 19, Position 5 = 21, Position 6 = 8
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 19
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 19
Branch analysis from position: 19
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/OmksK
function name:  (null)
number of ops:  23
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        ECHO                                                     !1
    5     7      > SWITCH_STRING                                            !1, [ 'k':->17, 'K':->17, 'm':->19, 'M':->19, ], ->21
    6     8    >   IS_EQUAL                                                 !1, 'k'
          9      > JMPNZ                                                    ~8, ->17
    7    10    >   IS_EQUAL                                                 !1, 'K'
         11      > JMPNZ                                                    ~8, ->17
   10    12    >   IS_EQUAL                                                 !1, 'm'
         13      > JMPNZ                                                    ~8, ->19
   11    14    >   IS_EQUAL                                                 !1, 'M'
         15      > JMPNZ                                                    ~8, ->19
         16    > > JMP                                                      ->21
    8    17    >   ECHO                                                     'k'
    9    18      > JMP                                                      ->22
   12    19    >   ECHO                                                     'k'
   14    20      > JMP                                                      ->22
   16    21    >   ECHO                                                     'o'
   19    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.3 ms | 1386 KiB | 13 Q