3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(f()); function f(){ switch('1'){ case 'ramen': return 'ramen'; case '1': return 'string("1")'; 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/PEbEP
function name:  (null)
number of ops:  6
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        DO_ICALL                                                 
   13     5      > 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/PEbEP
function name:  f
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   IS_EQUAL                                                 '1', 'ramen'
          1      > JMPNZ                                                    ~0, ->7
    7     2    >   IS_EQUAL                                                 '1', '1'
          3      > JMPNZ                                                    ~0, ->8
    9     4    >   IS_EQUAL                                                 '1', 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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.29 ms | 1387 KiB | 15 Q