3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_value($i) { switch ($i) { case 1; return 1; default; return 2; break; } } var_dump(get_value(1)); var_dump(get_value(2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o7nD8
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'get_value'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'get_value'
          8        SEND_VAL                                                 2
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function get_value:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o7nD8
function name:  get_value
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 1
          2      > JMPNZ                                                    ~1, ->4
          3    > > JMP                                                      ->5
    6     4    > > RETURN                                                   1
    8     5    > > RETURN                                                   2
    9     6*       JMP                                                      ->7
   11     7*     > RETURN                                                   null

End of function get_value

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.43 ms | 1398 KiB | 17 Q