3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array ( 0 => array ( 'Team' => 'Midtjylland', 'country' => 'dk', 'clubid' => '2', 'P' => '26', 'W' => '21', 'D' => '2', 'L' => '3', 'F' => '42', 'A' => '14', 'GD' => '28', 'Pts' => '65', 'form' => 'W,L,W,W,W,W,L,W,W,W,W,W,W,W,W,L,D,W,W,W,D,W,W,W,W,W', ), 1 => array ( 'Team' => 'København', 'country' => 'dk', 'clubid' => '1', 'P' => '26', 'W' => '18', 'D' => '2', 'L' => '6', 'F' => '47', 'A' => '29', 'GD' => '18', 'Pts' => '56', 'form' => 'W,W,L,W,D,L,W,W,W,W,L,W,W,W,L,W,D,L,L,W,W,W,W,W,W,W', ), 2 => array ( 'Team' => 'AGF', 'country' => 'dk', 'clubid' => '9', 'P' => '26', 'W' => '14', 'D' => '5', 'L' => '7', 'F' => '42', 'A' => '28', 'GD' => '14', 'Pts' => '47', 'form' => 'W,W,D,L,D,W,W,D,W,W,W,W,L,L,L,W,W,W,W,W,W,D,L,L,L,D', ), 3 => array ( 'Team' => 'Brøndby', 'country' => 'dk', 'clubid' => '4', 'P' => '26', 'W' => '13', 'D' => '3', 'L' => '10', 'F' => '47', 'A' => '37', 'GD' => '10', 'Pts' => '42', 'form' => 'L,W,D,W,L,W,D,L,L,L,W,W,W,W,W,L,L,W,L,L,W,W,L,W,D,W', ), 4 => array ( 'Team' => 'Nordsjælland', 'country' => 'dk', 'clubid' => '7', 'P' => '26', 'W' => '12', 'D' => '5', 'L' => '9', 'F' => '48', 'A' => '35', 'GD' => '13', 'Pts' => '41', 'form' => 'L,W,D,W,W,W,W,L,D,W,D,L,L,W,D,L,W,L,W,L,W,D,L,W,L,W', ), 5 => array ( 'Team' => 'AaB', 'country' => 'dk', 'clubid' => '6', 'P' => '26', 'W' => '11', 'D' => '5', 'L' => '10', 'F' => '44', 'A' => '33', 'GD' => '11', 'Pts' => '38', 'form' => 'L,D,W,L,W,W,L,D,D,W,D,L,W,W,W,L,L,L,W,W,L,W,L,W,D,L', ), 6 => array ( 'Team' => 'Randers', 'country' => 'dk', 'clubid' => '8', 'P' => '26', 'W' => '10', 'D' => '5', 'L' => '11', 'F' => '39', 'A' => '35', 'GD' => '4', 'Pts' => '35', 'form' => 'L,L,D,L,W,D,W,L,W,L,D,W,L,L,W,W,W,W,W,L,L,L,W,D,D,L', ), 7 => array ( 'Team' => 'Horsens', 'country' => 'dk', 'clubid' => '10', 'P' => '26', 'W' => '10', 'D' => '4', 'L' => '12', 'F' => '25', 'A' => '44', 'GD' => '-19', 'Pts' => '34', 'form' => 'W,W,W,L,L,L,W,D,W,L,W,D,L,W,L,D,L,D,W,L,L,L,W,L,W,L', ), 8 => array ( 'Team' => 'OB', 'country' => 'dk', 'clubid' => '3', 'P' => '26', 'W' => '9', 'D' => '6', 'L' => '11', 'F' => '34', 'A' => '30', 'GD' => '4', 'Pts' => '33', 'form' => 'W,L,D,D,D,L,L,D,L,L,L,W,W,L,W,W,L,W,D,D,L,W,W,L,W,L', ), 9 => array ( 'Team' => 'Lyngby', 'country' => 'dk', 'clubid' => '34', 'P' => '26', 'W' => '9', 'D' => '5', 'L' => '12', 'F' => '31', 'A' => '45', 'GD' => '-14', 'Pts' => '32', 'form' => 'D,L,L,L,W,L,W,D,D,D,W,L,W,L,D,W,W,L,L,W,L,L,W,L,L,W', ), 10 => array ( 'Team' => 'SønderjyskE', 'country' => 'dk', 'clubid' => '11', 'P' => '26', 'W' => '6', 'D' => '9', 'L' => '11', 'F' => '31', 'A' => '44', 'GD' => '-13', 'Pts' => '27', 'form' => 'D,L,D,L,L,W,L,W,L,D,L,L,L,L,W,W,D,D,D,L,D,D,L,W,D,W', ), 11 => array ( 'Team' => 'Hobro', 'country' => 'dk', 'clubid' => '13', 'P' => '26', 'W' => '3', 'D' => '14', 'L' => '9', 'F' => '25', 'A' => '35', 'GD' => '-10', 'Pts' => '23', 'form' => 'D,W,D,D,L,L,D,D,D,L,D,L,D,L,L,L,D,W,L,D,D,L,W,D,D,D', ), 12 => array ( 'Team' => 'Esbjerg', 'country' => 'dk', 'clubid' => '5', 'P' => '26', 'W' => '4', 'D' => '6', 'L' => '16', 'F' => '22', 'A' => '44', 'GD' => '-22', 'Pts' => '18', 'form' => 'L,D,D,L,L,W,L,L,L,W,L,D,L,L,L,D,W,L,L,D,W,L,L,L,D,L', ), 13 => array ( 'Team' => 'Silkeborg', 'country' => 'dk', 'clubid' => '33', 'P' => '26', 'W' => '3', 'D' => '7', 'L' => '16', 'F' => '31', 'A' => '55', 'GD' => '-24', 'Pts' => '16', 'form' => 'D,L,W,D,D,L,L,W,L,L,L,L,D,W,L,L,L,L,L,D,D,D,L,L,L,L', ), ); $arr2 = array ( 0 => array ( 'Team' => 'SønderjyskE', 'country' => 'dk', 'clubid' => '11', 'P' => '6', 'W' => '3', 'D' => '2', 'L' => '1', 'F' => '6', 'A' => '5', 'GD' => '1', 'Pts' => '11', 'form' => 'D,D,W,W,L,W', ), 1 => array ( 'Team' => 'Silkeborg', 'country' => 'dk', 'clubid' => '33', 'P' => '6', 'W' => '3', 'D' => '1', 'L' => '2', 'F' => '12', 'A' => '4', 'GD' => '8', 'Pts' => '10', 'form' => 'W,W,L,L,D,W', ), 2 => array ( 'Team' => 'OB', 'country' => 'dk', 'clubid' => '3', 'P' => '6', 'W' => '3', 'D' => '1', 'L' => '2', 'F' => '9', 'A' => '12', 'GD' => '-3', 'Pts' => '10', 'form' => 'L,D,W,W,W,L', ), 3 => array ( 'Team' => 'Lyngby', 'country' => 'dk', 'clubid' => '34', 'P' => '6', 'W' => '0', 'D' => '2', 'L' => '4', 'F' => '3', 'A' => '9', 'GD' => '-6', 'Pts' => '2', 'form' => 'D,L,L,L,D,L', ), ); foreach ($arr2 as $array) { $result[$array['clubid']] = $array; } foreach ($arr1 as $array) { if (isset($result[$array['clubid']])) { $result[$array['clubid']]['form'] .= ',' . $array['form']; foreach (['P', 'W', 'D', 'L', 'F', 'A', 'GD', 'Pts'] as $tally) { $result[$array['clubid']][$tally] += $array[$tally]; } } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 30
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 28
Branch analysis from position: 29
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 8
filename:       /in/KO04i
function name:  (null)
number of ops:  35
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $array, !3 = $result, !4 = $tally
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
  216     1        ASSIGN                                                   !1, <array>
  279     2      > FE_RESET_R                                       $7      !1, ->8
          3    > > FE_FETCH_R                                               $7, !2, ->8
  280     4    >   FETCH_DIM_R                                      ~8      !2, 'clubid'
          5        ASSIGN_DIM                                               !3, ~8
          6        OP_DATA                                                  !2
  279     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $7
  282     9      > FE_RESET_R                                       $10     !0, ->30
         10    > > FE_FETCH_R                                               $10, !2, ->30
  283    11    >   FETCH_DIM_R                                      ~11     !2, 'clubid'
         12        ISSET_ISEMPTY_DIM_OBJ                         0          !3, ~11
         13      > JMPZ                                                     ~12, ->29
  284    14    >   FETCH_DIM_R                                      ~13     !2, 'clubid'
         15        FETCH_DIM_R                                      ~16     !2, 'form'
         16        CONCAT                                           ~17     '%2C', ~16
         17        FETCH_DIM_RW                                     $14     !3, ~13
         18        ASSIGN_DIM_OP                .=               8          $14, 'form'
         19        OP_DATA                                                  ~17
  285    20      > FE_RESET_R                                       $18     <array>, ->28
         21    > > FE_FETCH_R                                               $18, !4, ->28
  286    22    >   FETCH_DIM_R                                      ~19     !2, 'clubid'
         23        FETCH_DIM_R                                      ~22     !2, !4
         24        FETCH_DIM_RW                                     $20     !3, ~19
         25        ASSIGN_DIM_OP                +=               1          $20, !4
         26        OP_DATA                                                  ~22
  285    27      > JMP                                                      ->21
         28    >   FE_FREE                                                  $18
  282    29    > > JMP                                                      ->10
         30    >   FE_FREE                                                  $10
  290    31        INIT_FCALL                                               'var_export'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.42 ms | 1450 KiB | 14 Q