3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 1; function &retRef() { global $var; return $var; } $x = retRef(); $x = 2; var_dump($var, $x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9FLYn
function name:  (null)
number of ops:  10
compiled vars:  !0 = $var, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    9     1        INIT_FCALL                                               'retref'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !1, $3
   10     4        ASSIGN                                                   !1, 2
   12     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function retref:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/9FLYn
function name:  retRef
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'var'
    6     1      > RETURN_BY_REF                                            !0
    7     2*     > RETURN_BY_REF                                            null

End of function retref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.12 ms | 1397 KiB | 16 Q