3v4l.org

run code in 300+ PHP versions simultaneously
<?php function byref(&$arg) { $arg++; } // no reference $arga = 1; $a = [$arga]; byref(...$a); echo $arga; // reference $argb = 1; $b = [&$argb]; byref(...$b); echo $argb;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aUNRG
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arga, !1 = $a, !2 = $argb, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 1
    9     1        INIT_ARRAY                                       ~5      !0
          2        ASSIGN                                                   !1, ~5
   10     3        INIT_FCALL                                               'byref'
          4        SEND_UNPACK                                              !1
          5        CHECK_UNDEF_ARGS                                         
          6        DO_FCALL                                      1          
   11     7        ECHO                                                     !0
   14     8        ASSIGN                                                   !2, 1
   15     9        INIT_ARRAY                                       ~9      !2
         10        ASSIGN                                                   !3, ~9
   16    11        INIT_FCALL                                               'byref'
         12        SEND_UNPACK                                              !3
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1          
   17    15        ECHO                                                     !2
         16      > RETURN                                                   1

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

End of function byref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.71 ms | 1005 KiB | 15 Q