3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('test1' => 1, 'test2' => 2,'test3' => 3,'test4' => 4,'test5' => 5,'test6' => 6,'test7' => 7,'test8' => 8); $originalArray = $array1; $array2 = array('a','b','c','d','e','f','g'); /* $n = count($array1); for($x = 0; $x < $n; $x++) { array_splice($array1, 1, -$x); print_r ($array1); $array1 = $originalArray; } */ $result = array_splice($array1, -3, 2, $array2); print_r ($array1); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RLqDj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array1, !1 = $originalArray, !2 = $array2, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, !0
    6     2        ASSIGN                                                   !2, <array>
   15     3        INIT_FCALL                                               'array_splice'
          4        SEND_REF                                                 !0
          5        SEND_VAL                                                 -3
          6        SEND_VAL                                                 2
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
   16    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   17    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.99 ms | 1394 KiB | 17 Q