3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [ 'u' => '30', 'v' => '16', 'w' => '22', 'x' => '30', 'y' => '16', 'z' => '22', ], [ 'u' => '32', 'v' => '25', 'w' => '1', 'x' => '30', 'y' => '16', 'z' => '22', ], [ 'u' => '30', 'v' => '16', 'w' => '22', 'x' => '54', 'y' => '96', 'z' => '2', ], [ 'u' => '30', 'v' => '16', 'w' => '22', 'x' => '3', 'y' => '1', 'z' => '6', ] ]; $result = []; foreach ($array as $row) { $key = vsprintf('%d_%d_%d', $row); if (!isset($ref[$key])){ $ref[$key] = $row; $result[] = &$ref[$key]; } else { $ref[$key]['x'] .= ',' . $row['x']; $ref[$key]['y'] .= ',' . $row['y']; $ref[$key]['z'] .= ',' . $row['z']; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 35
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 35
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
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: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/eV2eM
function name:  (null)
number of ops:  40
compiled vars:  !0 = $array, !1 = $result, !2 = $row, !3 = $key, !4 = $ref
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   38     1        ASSIGN                                                       !1, <array>
   39     2      > FE_RESET_R                                           $7      !0, ->35
          3    > > FE_FETCH_R                                                   $7, !2, ->35
   40     4    >   INIT_FCALL                                                   'vsprintf'
          5        SEND_VAL                                                     '%25d_%25d_%25d'
          6        SEND_VAR                                                     !2
          7        DO_ICALL                                             $8      
          8        ASSIGN                                                       !3, $8
   41     9        ISSET_ISEMPTY_DIM_OBJ                             0  ~10     !4, !3
         10        BOOL_NOT                                             ~11     ~10
         11      > JMPZ                                                         ~11, ->19
   42    12    >   ASSIGN_DIM                                                   !4, !3
         13        OP_DATA                                                      !2
   43    14        FETCH_DIM_W                                          $14     !4, !3
         15        MAKE_REF                                             $15     $14
         16        FETCH_DIM_W                                          $13     !1
         17        ASSIGN_REF                                                   $13, $15
   41    18      > JMP                                                          ->34
   45    19    >   FETCH_DIM_R                                          ~19     !2, 'x'
         20        CONCAT                                               ~20     '%2C', ~19
         21        FETCH_DIM_RW                                         $17     !4, !3
         22        ASSIGN_DIM_OP                    .=               8          $17, 'x'
         23        OP_DATA                                                      ~20
   46    24        FETCH_DIM_R                                          ~23     !2, 'y'
         25        CONCAT                                               ~24     '%2C', ~23
         26        FETCH_DIM_RW                                         $21     !4, !3
         27        ASSIGN_DIM_OP                    .=               8          $21, 'y'
         28        OP_DATA                                                      ~24
   47    29        FETCH_DIM_R                                          ~27     !2, 'z'
         30        CONCAT                                               ~28     '%2C', ~27
         31        FETCH_DIM_RW                                         $25     !4, !3
         32        ASSIGN_DIM_OP                    .=               8          $25, 'z'
         33        OP_DATA                                                      ~28
   39    34    > > JMP                                                          ->3
         35    >   FE_FREE                                                      $7
   50    36        INIT_FCALL                                                   'var_export'
         37        SEND_VAR                                                     !1
         38        DO_ICALL                                                     
         39      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.86 ms | 1809 KiB | 15 Q