3v4l.org

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

Function change:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
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: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VD31E
function name:  change
number of ops:  13
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 'X'
          2      > JMPNZ                                                    ~1, ->6
    8     3    >   IS_EQUAL                                                 !0, 6
          4      > JMPNZ                                                    ~1, ->8
          5    > > JMP                                                      ->10
    6     6    > > RETURN                                                   6
    7     7*       JMP                                                      ->12
    9     8    > > RETURN                                                   'X'
   10     9*       JMP                                                      ->12
   12    10    > > RETURN                                                   !0
   13    11*       JMP                                                      ->12
   15    12*     > RETURN                                                   null

End of function change

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.62 ms | 1013 KiB | 17 Q