3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.15 ms | 1407 KiB | 15 Q