3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 'Nov 18, 2011' => [ 'C' => 107705.5792, 'T' => 44561.52 ], 'Nov 22, 2011' => [ 'C' => -8992.8352 ] ]; $array2 = [ 'Nov 18, 2011' => [ 'C' => 3, 'T' => 1 ], 'Nov 22, 2011' => [ 'C' => 2 ] ]; $result = []; foreach ($array1 as $date => $row) { foreach ($row as $letter => $total) { $span = $array2[$date][$letter]; $result[$date][$span] = $total; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/Osf3Y
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result, !3 = $row, !4 = $date, !5 = $total, !6 = $letter, !7 = $span
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   23     2        ASSIGN                                                   !2, <array>
   24     3      > FE_RESET_R                                       $11     !0, ->18
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->18
          5    >   ASSIGN                                                   !4, ~12
   25     6      > FE_RESET_R                                       $14     !3, ->16
          7    > > FE_FETCH_R                                       ~15     $14, !5, ->16
          8    >   ASSIGN                                                   !6, ~15
   26     9        FETCH_DIM_R                                      ~17     !1, !4
         10        FETCH_DIM_R                                      ~18     ~17, !6
         11        ASSIGN                                                   !7, ~18
   27    12        FETCH_DIM_W                                      $20     !2, !4
         13        ASSIGN_DIM                                               $20, !7
         14        OP_DATA                                                  !5
   25    15      > JMP                                                      ->7
         16    >   FE_FREE                                                  $14
   24    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $11
   30    19        INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.69 ms | 1002 KiB | 14 Q