3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRef(&$var) { } function &returnRef1() { $a = 5; return $a; } function returnNonRef1() { $a = 5; return $a; } class A{ static function &returnRef2() { $a = 5; return $a; } function &returnRef3() { $a = 5; return $a; } } getRef(returnRef1()); getRef(A::returnRef2()); getRef((new A())->returnRef3()); getRef(returnNonRef1()); echo "Done\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/enq8m
function name:  (null)
number of ops:  24
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'getref'
          1        INIT_FCALL                                               'returnref1'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF                               0          $0
          4        DO_FCALL                                      0          
   24     5        INIT_FCALL                                               'getref'
          6        INIT_STATIC_METHOD_CALL                                  'A', 'returnRef2'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR_NO_REF                               0          $2
          9        DO_FCALL                                      0          
   25    10        INIT_FCALL                                               'getref'
         11        NEW                                              $4      'A'
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $4, 'returnRef3'
         14        DO_FCALL                                      0  $6      
         15        SEND_VAR_NO_REF                               0          $6
         16        DO_FCALL                                      0          
   26    17        INIT_FCALL                                               'getref'
         18        INIT_FCALL                                               'returnnonref1'
         19        DO_FCALL                                      0  $8      
         20        SEND_VAR_NO_REF                               0          $8
         21        DO_FCALL                                      0          
   27    22        ECHO                                                     'Done%0A'
         23      > RETURN                                                   1

Function getref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/enq8m
function name:  getRef
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function getref

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

End of function returnref1

Function returnnonref1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/enq8m
function name:  returnNonRef1
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 5
   10     1      > RETURN                                                   !0
   11     2*     > RETURN                                                   null

End of function returnnonref1

Class A:
Function returnref2:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/enq8m
function name:  returnRef2
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 5
   15     1      > RETURN_BY_REF                                            !0
   16     2*     > RETURN_BY_REF                                            null

End of function returnref2

Function returnref3:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/enq8m
function name:  returnRef3
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 5
   19     1      > RETURN_BY_REF                                            !0
   20     2*     > RETURN_BY_REF                                            null

End of function returnref3

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.01 ms | 1403 KiB | 19 Q