3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRef(&$var) { } function &returnRef1() { $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()); echo "Done\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hbNvJ
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     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          
   20     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          
   21    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          
   22    17        ECHO                                                     'Done%0A'
         18      > RETURN                                                   1

Function getref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hbNvJ
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/hbNvJ
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

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

End of function returnref2

Function returnref3:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/hbNvJ
function name:  returnRef3
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 returnref3

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.83 ms | 1407 KiB | 17 Q