3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 2, 3]; unset($array[3], $array[2]); $arrayCopy = $array; $arrayCopy[] = 2; assert($arrayCopy === [0, 1, 2]); // this assertion must pass; it doesn't currently $array[] = 2; assert($array === $arrayCopy); // still identical/equal
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vDj4c
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $arrayCopy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        UNSET_DIM                                                !0, 3
          2        UNSET_DIM                                                !0, 2
    6     3        ASSIGN                                                   !1, !0
    8     4        ASSIGN_DIM                                               !1
          5        OP_DATA                                                  2
    9     6        ASSERT_CHECK                                             
          7        INIT_FCALL                                               'assert'
          8        IS_IDENTICAL                                     ~5      !1, <array>
          9        SEND_VAL                                                 ~5
         10        SEND_VAL                                                 'assert%28%24arrayCopy+%3D%3D%3D+%5B0%2C+1%2C+2%5D%29'
         11        DO_ICALL                                                 
   11    12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  2
   12    14        ASSERT_CHECK                                             
         15        INIT_FCALL                                               'assert'
         16        IS_IDENTICAL                                     ~8      !0, !1
         17        SEND_VAL                                                 ~8
         18        SEND_VAL                                                 'assert%28%24array+%3D%3D%3D+%24arrayCopy%29'
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.2 ms | 1395 KiB | 15 Q