3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ['4', 'x' => 5]; // construct with duplicate keys var_dump(['x' => 4, 'x' => 6]); var_dump([2 => 4, 2.0 => 6]); // spread operator leading to duplicate keys var_dump(['x' => 4, ...$arr]); // destruct with duplicate keys ['x' => $a, 'x' => $b] = ['x' => 10]; var_dump([$a, $b]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NTFPM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $a, !2 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    6     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAL                                                     <array>
          3        DO_ICALL                                                     
    7     4        INIT_FCALL                                                   'var_dump'
          5        SEND_VAL                                                     <array>
          6        DO_ICALL                                                     
   10     7        INIT_FCALL                                                   'var_dump'
          8        INIT_ARRAY                                           ~6      4, 'x'
          9        ADD_ARRAY_UNPACK                                     ~6      !0
         10        SEND_VAL                                                     ~6
         11        DO_ICALL                                                     
   13    12        FETCH_LIST_R                                         $8      <array>, 'x'
         13        ASSIGN                                                       !1, $8
         14        FETCH_LIST_R                                         $10     <array>, 'x'
         15        ASSIGN                                                       !2, $10
   14    16        INIT_FCALL                                                   'var_dump'
         17        INIT_ARRAY                                           ~12     !1
         18        ADD_ARRAY_ELEMENT                                    ~12     !2
         19        SEND_VAL                                                     ~12
         20        DO_ICALL                                                     
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.85 ms | 1883 KiB | 14 Q