3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['FA',12.9], ['FA',12.9], ['FB',12.2], ['FC',12.3], ['FA',12.9], ['FB',12.9], ['FA',12.4], ]; $grouped = []; foreach ($array as $row) { $compositeKey = implode($row); if (!isset($grouped[$compositeKey])) { $grouped[$compositeKey] = array_merge($row, [1]); } else { ++$grouped[$compositeKey][2]; } } foreach ($grouped as $row) { vprintf("%s %0.1fx%d\n", $row); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 22
filename:       /in/vVVGN
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $grouped, !2 = $row, !3 = $compositeKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_R                                       $6      !0, ->22
          3    > > FE_FETCH_R                                               $6, !2, ->22
   15     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !3, $7
   16     8        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      !1, !3
          9        BOOL_NOT                                         ~10     ~9
         10      > JMPZ                                                     ~10, ->18
   17    11    >   INIT_FCALL                                               'array_merge'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                         $12     
         15        ASSIGN_DIM                                               !1, !3
         16        OP_DATA                                                  $12
   16    17      > JMP                                                      ->21
   19    18    >   FETCH_DIM_RW                                     $13     !1, !3
         19        FETCH_DIM_RW                                     $14     $13, 2
         20        PRE_INC                                                  $14
   14    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $6
   23    23      > FE_RESET_R                                       $16     !1, ->30
         24    > > FE_FETCH_R                                               $16, !2, ->30
   24    25    >   INIT_FCALL                                               'vprintf'
         26        SEND_VAL                                                 '%25s+%250.1fx%25d%0A'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   23    29      > JMP                                                      ->24
         30    >   FE_FREE                                                  $16
   25    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.87 ms | 1005 KiB | 16 Q