3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $foo = 'bar'; switch ($foo) { case 'bar': echo "bar"; break; case 'zot': { echo 'zot'; break; } case 'fot': { echo "fot"; } } } test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VEJVL
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 9, Position 2 = 11, Position 3 = 13, Position 4 = 14, Position 5 = 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 13
Branch analysis from position: 11
Branch analysis from position: 9
filename:       /in/VEJVL
function name:  test
number of ops:  15
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'bar'
    9     1      > SWITCH_STRING                                            !0, [ 'bar':->9, 'zot':->11, 'fot':->13, ], ->14
   12     2    >   IS_EQUAL                                                 !0, 'bar'
          3      > JMPNZ                                                    ~2, ->9
   16     4    >   IS_EQUAL                                                 !0, 'zot'
          5      > JMPNZ                                                    ~2, ->11
   21     6    >   IS_EQUAL                                                 !0, 'fot'
          7      > JMPNZ                                                    ~2, ->13
          8    > > JMP                                                      ->14
   13     9    >   ECHO                                                     'bar'
   14    10      > JMP                                                      ->14
   17    11    >   ECHO                                                     'zot'
   18    12      > JMP                                                      ->14
   22    13    >   ECHO                                                     'fot'
   27    14    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.57 ms | 1399 KiB | 14 Q