3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["444", "0081"], ["449", "0081"], ["451", "0081"], ["455", "2100"], ["469", "2100"] ]; $result = []; foreach ($array as $row) { if (!isset($ref[$row[1]])) { $ref[$row[1]] = $row; $result[] = &$ref[$row[1]]; } else { $ref[$row[1]][0] .= ',' . $row[0]; } } 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 = 8, Position 2 = 17
Branch analysis from position: 8
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: 17
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/0F5IJ
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $result, !2 = $row, !3 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2      > FE_RESET_R                                       $6      !0, ->24
          3    > > FE_FETCH_R                                               $6, !2, ->24
   12     4    >   FETCH_DIM_R                                      ~7      !2, 1
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      !3, ~7
          6        BOOL_NOT                                         ~9      ~8
          7      > JMPZ                                                     ~9, ->17
   13     8    >   FETCH_DIM_R                                      ~10     !2, 1
          9        ASSIGN_DIM                                               !3, ~10
         10        OP_DATA                                                  !2
   14    11        FETCH_DIM_R                                      ~13     !2, 1
         12        FETCH_DIM_W                                      $14     !3, ~13
         13        MAKE_REF                                         $15     $14
         14        FETCH_DIM_W                                      $12     !1
         15        ASSIGN_REF                                               $12, $15
   12    16      > JMP                                                      ->23
   16    17    >   FETCH_DIM_R                                      ~17     !2, 1
         18        FETCH_DIM_R                                      ~20     !2, 0
         19        CONCAT                                           ~21     '%2C', ~20
         20        FETCH_DIM_RW                                     $18     !3, ~17
         21        ASSIGN_DIM_OP                .=               8          $18, 0
         22        OP_DATA                                                  ~21
   11    23    > > JMP                                                      ->3
         24    >   FE_FREE                                                  $6
   19    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:
145.8 ms | 1006 KiB | 14 Q