3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(f(),f2()); function f(){ switch(0){ case 'ramen': return 'ramen'; case 'a': return 'string("1")'; case 1: return 'int(1)'; default: return 'default'; }} function f2(){ $v=0; switch($v){ case 'ramen': return 'ramen'; case 'A': return 'string("1")'; case 5: return "int(5)"; case 1: return 'int(1)'; default: return 'default'; }}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gaec
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL_BY_NAME                                       'f'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        INIT_FCALL_BY_NAME                                       'f2'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   28     8      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gaec
function name:  f
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   IS_EQUAL                                                 0, 'ramen'
          1      > JMPNZ                                                    ~0, ->7
    7     2    >   IS_EQUAL                                                 0, 'a'
          3      > JMPNZ                                                    ~0, ->8
    9     4    >   IS_EQUAL                                                 0, 1
          5      > JMPNZ                                                    ~0, ->9
          6    > > JMP                                                      ->10
    6     7    > > RETURN                                                   'ramen'
    8     8    > > RETURN                                                   'string%28%221%22%29'
   10     9    > > RETURN                                                   'int%281%29'
   12    10    > > RETURN                                                   'default'
   13    11*     > RETURN                                                   null

End of function f

Function f2:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 13
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: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Gaec
function name:  f2
number of ops:  16
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 0
   18     1        IS_EQUAL                                                 !0, 'ramen'
          2      > JMPNZ                                                    ~2, ->10
   20     3    >   IS_EQUAL                                                 !0, 'A'
          4      > JMPNZ                                                    ~2, ->11
   22     5    >   IS_EQUAL                                                 !0, 5
          6      > JMPNZ                                                    ~2, ->12
   24     7    >   IS_EQUAL                                                 !0, 1
          8      > JMPNZ                                                    ~2, ->13
          9    > > JMP                                                      ->14
   19    10    > > RETURN                                                   'ramen'
   21    11    > > RETURN                                                   'string%28%221%22%29'
   23    12    > > RETURN                                                   'int%285%29'
   25    13    > > RETURN                                                   'int%281%29'
   27    14    > > RETURN                                                   'default'
   28    15*     > RETURN                                                   null

End of function f2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.72 ms | 1392 KiB | 15 Q