3v4l.org

run code in 300+ PHP versions simultaneously
<?php $error = array( 'qwerty1' => 1, 'qwerty3' => 3 ); $error = array_slice($error, 0, 1, true) + array('qwerty2' => 2) + array_slice($error, 1, NULL, true); var_dump($error);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hVrLo
function name:  (null)
number of ops:  20
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_slice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
    9     7        ADD                                              ~3      $2, <array>
   10     8        INIT_FCALL                                               'array_slice'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 1
         11        SEND_VAL                                                 null
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $4      
         14        ADD                                              ~5      ~3, $4
    8    15        ASSIGN                                                   !0, ~5
   12    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
238.89 ms | 1002 KiB | 15 Q