3v4l.org

run code in 500+ PHP versions simultaneously
<?php const A = 1; function &foo(&$a) { return []; } $a = 1; $a = foo($a); // Notice: Only variable references should be returned by reference foo(1); // Fatal error: Uncaught Error: foo(): Argument #1 ($a) cannot be passed by reference ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6knLV
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                                'A', 1
    9     1        ASSIGN                                                       !0, 1
   10     2        INIT_FCALL                                                   'foo'
          3        SEND_REF                                                     !0
          4        DO_FCALL                                          0  $2      
          5        ASSIGN                                                       !0, $2
   13     6        INIT_FCALL                                                   'foo'
          7        SEND_VAL_EX                                                  1
          8        DO_FCALL                                          0          
   16     9      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/6knLV
function name:  foo
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1      > RETURN_BY_REF                                                <array>
    7     2*     > RETURN_BY_REF                                                null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.19 ms | 1494 KiB | 15 Q