3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1); $a =& $arr[0]; //$a and $arr[0] are in the same reference set $arr2 = $arr; //not an assignment-by-reference! $arr2[0]++; /* $a == 2, $arr == array(2) */ /* The contents of $arr are changed even though it's not a reference! */ var_dump($a); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHBhb
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arr, !1 = $a, !2 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $4      !0, 0
          2        ASSIGN_REF                                               !1, $4
    5     3        ASSIGN                                                   !2, !0
    6     4        FETCH_DIM_RW                                     $7      !2, 0
          5        PRE_INC                                                  $7
   12     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.09 ms | 1385 KiB | 15 Q