3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $wineBuys = array ( '2013-09-12' => 20, '2013-09-13' => 10, '2013-09-14' => 49 ); $hamBuys = array ( '2013-09-12' => 1, '2013-09-13' => 16, '2013-09-14' => 2 ); $cheeseBuys = array ( '2013-09-12' => 5, '2013-09-13' => 6, '2013-09-14' => 12 ); $calcByDate = array(); foreach ($wineBuys as $key => $value) { if (! array_key_exists($key, $calcByDate)) { $calcByDate[$key] = array($wineBuys[$key]); } else { $calcByDate[$key][] = $wineBuys[$key]; } } foreach ($hamBuys as $key => $value) { if (! array_key_exists($key, $calcByDate)) { $calcByDate[$key] = array($hamBuys[$key]); } else { $calcByDate[$key][] = $hamBuys[$key]; } } foreach ($cheeseBuys as $key => $value) { if (! array_key_exists($key, $calcByDate)) { $calcByDate[$key] = array($cheeseBuys[$key]); } else { $calcByDate[$key][] = $cheeseBuys[$key]; } } print_r($calcByDate);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 37
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 54
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 54
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 49
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 37
Branch analysis from position: 20
filename:       /in/dPMtW
function name:  (null)
number of ops:  59
compiled vars:  !0 = $wineBuys, !1 = $hamBuys, !2 = $cheeseBuys, !3 = $calcByDate, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, <array>
   21     3        ASSIGN                                                   !3, <array>
   23     4      > FE_RESET_R                                       $10     !0, ->20
          5    > > FE_FETCH_R                                       ~11     $10, !4, ->20
          6    >   ASSIGN                                                   !5, ~11
   24     7        ARRAY_KEY_EXISTS                                 ~13     !5, !3
          8        BOOL_NOT                                         ~14     ~13
          9      > JMPZ                                                     ~14, ->15
   25    10    >   FETCH_DIM_R                                      ~16     !0, !5
         11        INIT_ARRAY                                       ~17     ~16
         12        ASSIGN_DIM                                               !3, !5
         13        OP_DATA                                                  ~17
         14      > JMP                                                      ->19
   28    15    >   FETCH_DIM_R                                      ~20     !0, !5
         16        FETCH_DIM_W                                      $18     !3, !5
         17        ASSIGN_DIM                                               $18
         18        OP_DATA                                                  ~20
   23    19    > > JMP                                                      ->5
         20    >   FE_FREE                                                  $10
   32    21      > FE_RESET_R                                       $21     !1, ->37
         22    > > FE_FETCH_R                                       ~22     $21, !4, ->37
         23    >   ASSIGN                                                   !5, ~22
   33    24        ARRAY_KEY_EXISTS                                 ~24     !5, !3
         25        BOOL_NOT                                         ~25     ~24
         26      > JMPZ                                                     ~25, ->32
   34    27    >   FETCH_DIM_R                                      ~27     !1, !5
         28        INIT_ARRAY                                       ~28     ~27
         29        ASSIGN_DIM                                               !3, !5
         30        OP_DATA                                                  ~28
         31      > JMP                                                      ->36
   37    32    >   FETCH_DIM_R                                      ~31     !1, !5
         33        FETCH_DIM_W                                      $29     !3, !5
         34        ASSIGN_DIM                                               $29
         35        OP_DATA                                                  ~31
   32    36    > > JMP                                                      ->22
         37    >   FE_FREE                                                  $21
   41    38      > FE_RESET_R                                       $32     !2, ->54
         39    > > FE_FETCH_R                                       ~33     $32, !4, ->54
         40    >   ASSIGN                                                   !5, ~33
   42    41        ARRAY_KEY_EXISTS                                 ~35     !5, !3
         42        BOOL_NOT                                         ~36     ~35
         43      > JMPZ                                                     ~36, ->49
   43    44    >   FETCH_DIM_R                                      ~38     !2, !5
         45        INIT_ARRAY                                       ~39     ~38
         46        ASSIGN_DIM                                               !3, !5
         47        OP_DATA                                                  ~39
         48      > JMP                                                      ->53
   46    49    >   FETCH_DIM_R                                      ~42     !2, !5
         50        FETCH_DIM_W                                      $40     !3, !5
         51        ASSIGN_DIM                                               $40
         52        OP_DATA                                                  ~42
   41    53    > > JMP                                                      ->39
         54    >   FE_FREE                                                  $32
   56    55        INIT_FCALL                                               'print_r'
         56        SEND_VAR                                                 !3
         57        DO_ICALL                                                 
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.93 ms | 1392 KiB | 15 Q