3v4l.org

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

Function f1:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/9LdkK
function name:  f1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN_BY_REF                                            -1
          1*     > RETURN_BY_REF                                            null

End of function f1

Function f2:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/9LdkK
function name:  f2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_CONSTANT                                   ~0      'MYERROR'
          1      > RETURN_BY_REF                                            ~0
          2*     > RETURN_BY_REF                                            null

End of function f2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.31 ms | 1001 KiB | 17 Q