3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($fakeRandomResult) { $value = 's'; switch ($value) { case 's': $value = $fakeRandomResult; case 'h': //… return '$h'; case 'v': //… return '$v'; } } echo test('h'), "\n"; echo test('v'), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DsOA7
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 'h'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4        ECHO                                                     '%0A'
   23     5        INIT_FCALL                                               'test'
          6        SEND_VAL                                                 'v'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
          9        ECHO                                                     '%0A'
         10      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 10, Position 2 = 11, Position 3 = 12, Position 4 = 13, Position 5 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
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 = 11
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 12
Branch analysis from position: 11
Branch analysis from position: 10
filename:       /in/DsOA7
function name:  test
number of ops:  14
compiled vars:  !0 = $fakeRandomResult, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 's'
    6     2      > SWITCH_STRING                                            !1, [ 's':->10, 'h':->11, 'v':->12, ], ->13
    7     3    >   IS_EQUAL                                                 !1, 's'
          4      > JMPNZ                                                    ~3, ->10
   10     5    >   IS_EQUAL                                                 !1, 'h'
          6      > JMPNZ                                                    ~3, ->11
   15     7    >   IS_EQUAL                                                 !1, 'v'
          8      > JMPNZ                                                    ~3, ->12
          9    > > JMP                                                      ->13
    8    10    >   ASSIGN                                                   !1, !0
   13    11    > > RETURN                                                   '%24h'
   18    12    > > RETURN                                                   '%24v'
   20    13    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.28 ms | 1438 KiB | 15 Q