3v4l.org

run code in 500+ 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 = 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 = 9, Position 2 = 16
Branch analysis from position: 9
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: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 20
filename:       /in/vVVGN
function name:  (null)
number of ops:  30
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, ->20
          3    > > FE_FETCH_R                                                   $6, !2, ->20
   15     4    >   FRAMELESS_ICALL_1                implode             ~7      !2
          5        ASSIGN                                                       !3, ~7
   16     6        ISSET_ISEMPTY_DIM_OBJ                             0  ~9      !1, !3
          7        BOOL_NOT                                             ~10     ~9
          8      > JMPZ                                                         ~10, ->16
   17     9    >   INIT_FCALL                                                   'array_merge'
         10        SEND_VAR                                                     !2
         11        SEND_VAL                                                     <array>
         12        DO_ICALL                                             $12     
         13        ASSIGN_DIM                                                   !1, !3
         14        OP_DATA                                                      $12
   16    15      > JMP                                                          ->19
   19    16    >   FETCH_DIM_RW                                         $13     !1, !3
         17        FETCH_DIM_RW                                         $14     $13, 2
         18        PRE_INC                                                      $14
   14    19    > > JMP                                                          ->3
         20    >   FE_FREE                                                      $6
   23    21      > FE_RESET_R                                           $16     !1, ->28
         22    > > FE_FETCH_R                                                   $16, !2, ->28
   24    23    >   INIT_FCALL                                                   'vprintf'
         24        SEND_VAL                                                     '%25s+%250.1fx%25d%0A'
         25        SEND_VAR                                                     !2
         26        DO_ICALL                                                     
   23    27      > JMP                                                          ->22
         28    >   FE_FREE                                                      $16
   25    29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
197.24 ms | 1885 KiB | 15 Q