3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [1,2,3]; $arr2 = $arr1; $arr2[1] = 2; debug_zval_dump('arr2'); key($arr2); debug_zval_dump('arr2'); unset($arr1); unset($arr2); $arr1 = [1,2,3]; $arr2 = $arr1; debug_zval_dump('arr2'); end($arr2); debug_zval_dump('arr2');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXbv2
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, !0
    4     2        ASSIGN_DIM                                               !1, 1
          3        OP_DATA                                                  2
    5     4        INIT_FCALL                                               'debug_zval_dump'
          5        SEND_VAL                                                 'arr2'
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'key'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'debug_zval_dump'
         11        SEND_VAL                                                 'arr2'
         12        DO_ICALL                                                 
    9    13        UNSET_CV                                                 !0
   10    14        UNSET_CV                                                 !1
   12    15        ASSIGN                                                   !0, <array>
   13    16        ASSIGN                                                   !1, !0
   15    17        INIT_FCALL                                               'debug_zval_dump'
         18        SEND_VAL                                                 'arr2'
         19        DO_ICALL                                                 
   16    20        INIT_FCALL                                               'end'
         21        SEND_REF                                                 !1
         22        DO_ICALL                                                 
   17    23        INIT_FCALL                                               'debug_zval_dump'
         24        SEND_VAL                                                 'arr2'
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.82 ms | 1395 KiB | 19 Q