3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array(2, 3); $arr2 = $arr1; $arr2[] = 4; // $arr2 is changed, // $arr1 is still array(2, 3) $arr3 = &$arr1; $arr3[] = 4; // now $arr1 and $arr3 are the same $arr4 = (array)$arr1; $arr1[] = 4; var_dump($arr1); var_dump($arr4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9t18g
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $arr3, !3 = $arr4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, !0
    5     2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  4
    8     4        ASSIGN_REF                                               !2, !0
    9     5        ASSIGN_DIM                                               !2
          6        OP_DATA                                                  4
   11     7        CAST                                          7  ~9      !0
          8        ASSIGN                                                   !3, ~9
   12     9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  4
   13    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   14    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.59 ms | 1398 KiB | 15 Q