3v4l.org

run code in 300+ PHP versions simultaneously
<?php function & do_something(& $arg) { $arg = 'func value'; return $arg; } $a = 'initial value'; $b = do_something($a); $b = 'new value'; var_dump($a, $b); $x = 'initial value'; $y = & do_something($x); $y = 'new value'; var_dump($x, $y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/68J5B
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b, !2 = $x, !3 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'initial+value'
   10     1        INIT_FCALL                                               'do_something'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
   11     5        ASSIGN                                                   !1, 'new+value'
   12     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   14    10        ASSIGN                                                   !2, 'initial+value'
   15    11        INIT_FCALL                                               'do_something'
         12        SEND_REF                                                 !2
         13        DO_FCALL                                      0  $10     
         14        ASSIGN_REF                                               !3, $10
   16    15        ASSIGN                                                   !3, 'new+value'
   17    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function do_something:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/68J5B
function name:  do_something
number of ops:  4
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !0, 'func+value'
    6     2      > RETURN_BY_REF                                            !0
    7     3*     > RETURN_BY_REF                                            null

End of function do_something

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.61 ms | 1398 KiB | 17 Q