3v4l.org

run code in 500+ PHP versions simultaneously
<?php $missedFridgeLog = [ [ "date" => "01/01/18", "name" => "Medicine" ], [ "date" => "01/01/18", "name" => "Drugs" ], [ "date" => "02/01/18", "name" => "Medicine" ], [ "date" => "02/01/18", "name" => "Drugs" ] ]; $result = []; foreach ($missedFridgeLog as $row) { if (!isset($result[$row['date']])) { $result[$row['date']] = $row; } else { $result[$row['date']]['name'] .= ",{$row['name']}"; } } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/vVZpi
function name:  (null)
number of ops:  28
compiled vars:  !0 = $missedFridgeLog, !1 = $result, !2 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   21     1        ASSIGN                                                       !1, <array>
   22     2      > FE_RESET_R                                           $5      !0, ->20
          3    > > FE_FETCH_R                                                   $5, !2, ->20
   23     4    >   FETCH_DIM_R                                          ~6      !2, 'date'
          5        ISSET_ISEMPTY_DIM_OBJ                             0  ~7      !1, ~6
          6        BOOL_NOT                                             ~8      ~7
          7      > JMPZ                                                         ~8, ->12
   24     8    >   FETCH_DIM_R                                          ~9      !2, 'date'
          9        ASSIGN_DIM                                                   !1, ~9
         10        OP_DATA                                                      !2
   23    11      > JMP                                                          ->19
   26    12    >   FETCH_DIM_R                                          ~11     !2, 'date'
         13        NOP                                                          
         14        FETCH_DIM_R                                          ~14     !2, 'name'
         15        FAST_CONCAT                                          ~15     '%2C', ~14
         16        FETCH_DIM_RW                                         $12     !1, ~11
         17        ASSIGN_DIM_OP                    .=               8          $12, 'name'
         18        OP_DATA                                                      ~15
   22    19    > > JMP                                                          ->3
         20    >   FE_FREE                                                      $5
   29    21        INIT_FCALL                                                   'var_export'
         22        INIT_FCALL                                                   'array_values'
         23        SEND_VAR                                                     !1
         24        DO_ICALL                                             $16     
         25        SEND_VAR                                                     $16
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.67 ms | 1923 KiB | 15 Q