3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){echo __FUNCTION__;} function bar(){echo __FUNCTION__;} function baz(){echo __FUNCTION__;} function barfl(){echo __FUNCTION__;} $str = "foo"; switch ($str) { case "foo": foo(); break; case "bar": bar(); break; case "baz": baz(); break; case "barfl": barfl(); break; }
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 188) Position 1 = 11, Position 2 = 14, Position 3 = 17, Position 4 = 20, Position 5 = 23, Position 6 = 2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 23
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 20
Branch analysis from position: 17
Branch analysis from position: 14
Branch analysis from position: 11
filename:       /in/1psN8
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'foo'
    7     1      > SWITCH_STRING                                            !0, [ 'foo':->11, 'bar':->14, 'baz':->17, 'barfl':->20, ], ->23
    8     2    >   IS_EQUAL                                                 !0, 'foo'
          3      > JMPNZ                                                    ~2, ->11
   11     4    >   IS_EQUAL                                                 !0, 'bar'
          5      > JMPNZ                                                    ~2, ->14
   14     6    >   IS_EQUAL                                                 !0, 'baz'
          7      > JMPNZ                                                    ~2, ->17
   17     8    >   IS_EQUAL                                                 !0, 'barfl'
          9      > JMPNZ                                                    ~2, ->20
         10    > > JMP                                                      ->23
    9    11    >   INIT_FCALL                                               'foo'
         12        DO_FCALL                                      0          
   10    13      > JMP                                                      ->23
   12    14    >   INIT_FCALL                                               'bar'
         15        DO_FCALL                                      0          
   13    16      > JMP                                                      ->23
   15    17    >   INIT_FCALL                                               'baz'
         18        DO_FCALL                                      0          
   16    19      > JMP                                                      ->23
   18    20    >   INIT_FCALL                                               'barfl'
         21        DO_FCALL                                      0          
   19    22      > JMP                                                      ->23
   20    23    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1psN8
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'foo'
          1      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1psN8
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'bar'
          1      > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1psN8
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'baz'
          1      > RETURN                                                   null

End of function baz

Function barfl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1psN8
function name:  barfl
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'barfl'
          1      > RETURN                                                   null

End of function barfl

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.58 ms | 1403 KiB | 17 Q