3v4l.org

run code in 300+ PHP versions simultaneously
<?php function change($input) { $return = $input; switch($input) { case 'X': $return = 6; break; case 6: $return = 'X'; break; } return $return; } 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/V722p
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 = 4, Position 2 = 7
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 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/V722p
function name:  change
number of ops:  13
compiled vars:  !0 = $input, !1 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, !0
    6     2        IS_EQUAL                                                 !0, 'X'
          3      > JMPNZ                                                    ~3, ->7
    9     4    >   IS_EQUAL                                                 !0, 6
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
    7     7    >   ASSIGN                                                   !1, 6
    8     8      > JMP                                                      ->11
   10     9    >   ASSIGN                                                   !1, 'X'
   11    10      > JMP                                                      ->11
   14    11    > > RETURN                                                   !1
   15    12*     > RETURN                                                   null

End of function change

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.53 ms | 1008 KiB | 17 Q