3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = ['a' => '1','b' => 2]; $arr2 = ['h' => 'c','j' => '3', 'y' => 'bar', 'z' => 'foo']; $result = []; for ($i = 0, $count = count($arr1); $i < $count; ++$i) { $result += array_slice($arr1, $i, 1) + array_slice($arr2, $i, 1); } $result += $arr1 + $arr2; 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/tNcU3
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $result, !3 = $i, !4 = $count
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>
    7     3        ASSIGN                                                   !3, 0
          4        COUNT                                            ~9      !0
          5        ASSIGN                                                   !4, ~9
          6      > JMP                                                      ->20
    8     7    >   INIT_FCALL                                               'array_slice'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !3
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $11     
    9    12        INIT_FCALL                                               'array_slice'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $12     
         17        ADD                                              ~13     $11, $12
         18        ASSIGN_OP                                     1          !2, ~13
    7    19        PRE_INC                                                  !3
         20    >   IS_SMALLER                                               !3, !4
         21      > JMPNZ                                                    ~16, ->7
   11    22    >   ADD                                              ~17     !0, !1
         23        ASSIGN_OP                                     1          !2, ~17
   12    24        INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.16 ms | 1003 KiB | 15 Q