3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_1 = array(1,2,3,4,5); $array_2 = array('a','b','c'); $positions = array(1,3,4); $positionArray = array_combine($positions, $array_2); foreach($positionArray as $key => $value){ array_splice($array_1, $key, 0, $value); } print_r($array_1);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/Djar2
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array_1, !1 = $array_2, !2 = $positions, !3 = $positionArray, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    8     3        INIT_FCALL                                               'array_combine'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !3, $9
   11     8      > FE_RESET_R                                       $11     !3, ->18
          9    > > FE_FETCH_R                                       ~12     $11, !4, ->18
         10    >   ASSIGN                                                   !5, ~12
   12    11        INIT_FCALL                                               'array_splice'
         12        SEND_REF                                                 !0
         13        SEND_VAR                                                 !5
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                                 
   11    17      > JMP                                                      ->9
         18    >   FE_FREE                                                  $11
   15    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.68 ms | 1004 KiB | 16 Q