3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ 'a', 'b', 'c', ]; // Our first index $firstIndex = 10; // Index before first $tmpIndex = $firstIndex - 1; // Re-index with a temporary $array = [$tmpIndex => null, ...$data]; // Remove temporary unset($array[$tmpIndex]); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nrYWK
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data, !1 = $firstIndex, !2 = $tmpIndex, !3 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, 10
   13     2        SUB                                                  ~6      !1, 1
          3        ASSIGN                                                       !2, ~6
   16     4        INIT_ARRAY                                           ~8      null, !2
          5        ADD_ARRAY_UNPACK                                     ~8      !0
          6        ASSIGN                                                       !3, ~8
   19     7        UNSET_DIM                                                    !3, !2
   21     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !3
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
147.9 ms | 3379 KiB | 14 Q