3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["d" => "7 Apr 2024", "s" => "pm", "i" => "el"], ["d" => "8 Apr 2024", "s" => "am", "i" => "mn"], ["d" => "12 Apr 2024", "s" => "pm", "i" => "mr"], ["d" => "12 Apr 2024", "s" => "am", "i" => "mr"], ["d" => "12 Apr 2024", "s" => "am", "i" => "da"], ["d" => "13 Apr 2024", "s" => "pm", "i" => "li"], ["d" => "14 Apr 2024", "s" => "am", "i" => "li"], ["d" => "15 Apr 2024", "s" => "mid", "i" => "nd"], ["d" => "15 Apr 2024", "s" => "pm", "i" => "da"] ]; $result = []; foreach ($array as ['d' => $d, 's' => $s, 'i' => $i]) { if (!isset($result[$d][$s])) { $result[$d][$s] = $i; } else { $result[$d][$s] .= ',' . $i; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/9gWFd
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $result, !2 = $d, !3 = $s, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $7      !0, ->24
          3    > > FE_FETCH_R                                               $7, $8, ->24
          4    >   FETCH_LIST_R                                     $9      $8, 'd'
          5        ASSIGN                                                   !2, $9
          6        FETCH_LIST_R                                     $11     $8, 's'
          7        ASSIGN                                                   !3, $11
          8        FETCH_LIST_R                                     $13     $8, 'i'
          9        ASSIGN                                                   !4, $13
         10        FREE                                                     $8
   17    11        FETCH_DIM_IS                                     ~15     !1, !2
         12        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     ~15, !3
         13        BOOL_NOT                                         ~17     ~16
         14      > JMPZ                                                     ~17, ->19
   18    15    >   FETCH_DIM_W                                      $18     !1, !2
         16        ASSIGN_DIM                                               $18, !3
         17        OP_DATA                                                  !4
   17    18      > JMP                                                      ->23
   20    19    >   CONCAT                                           ~22     '%2C', !4
         20        FETCH_DIM_RW                                     $20     !1, !2
         21        ASSIGN_DIM_OP                .=               8          $20, !3
         22        OP_DATA                                                  ~22
   16    23    > > JMP                                                      ->3
         24    >   FE_FREE                                                  $7
   23    25        INIT_FCALL                                               'var_export'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.66 ms | 998 KiB | 14 Q