3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr1 = ['a' => '1','b' => 2, 'z' => 'foo']; $arr2 = ['h' => 'c','j' => '3']; $count = count($arr1); $result = []; for ($i = 0; $i < $count; ++$i) { $result += array_slice($arr1, $i, 1) + array_slice($arr2, $i, 1); } $result += array_slice($arr1, $count) + array_slice($arr2, $count); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 7
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 7
Branch analysis from position: 22
Branch analysis from position: 7
filename:       /in/8L6HK
function name:  (null)
number of ops:  36
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $count, !3 = $result, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        COUNT                                                ~7      !0
          3        ASSIGN                                                       !2, ~7
    7     4        ASSIGN                                                       !3, <array>
    8     5        ASSIGN                                                       !4, 0
          6      > JMP                                                          ->20
    9     7    >   INIT_FCALL                                                   'array_slice'
          8        SEND_VAR                                                     !0
          9        SEND_VAR                                                     !4
         10        SEND_VAL                                                     1
         11        DO_ICALL                                             $11     
   10    12        INIT_FCALL                                                   'array_slice'
         13        SEND_VAR                                                     !1
         14        SEND_VAR                                                     !4
         15        SEND_VAL                                                     1
         16        DO_ICALL                                             $12     
         17        ADD                                                  ~13     $11, $12
         18        ASSIGN_OP                                         1          !3, ~13
    8    19        PRE_INC                                                      !4
         20    >   IS_SMALLER                                                   !4, !2
         21      > JMPNZ                                                        ~16, ->7
   12    22    >   INIT_FCALL                                                   'array_slice'
         23        SEND_VAR                                                     !0
         24        SEND_VAR                                                     !2
         25        DO_ICALL                                             $17     
   13    26        INIT_FCALL                                                   'array_slice'
         27        SEND_VAR                                                     !1
         28        SEND_VAR                                                     !2
         29        DO_ICALL                                             $18     
         30        ADD                                                  ~19     $17, $18
         31        ASSIGN_OP                                         1          !3, ~19
   14    32        INIT_FCALL                                                   'var_export'
         33        SEND_VAR                                                     !3
         34        DO_ICALL                                                     
         35      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
147.41 ms | 1894 KiB | 15 Q