3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ ['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4], ['id' => 4], ['id' => 4], ['id' => 5] ]; $r = array_count_values(array_column($records, 'id')); foreach($r as $k => $v){ echo $k; echo ($v>1) ? " ({$v})" : ''; echo ''."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/EJSCP
function name:  (null)
number of ops:  26
compiled vars:  !0 = $records, !1 = $r, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_count_values'
          2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'id'
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   12     9      > FE_RESET_R                                       $8      !1, ->24
         10    > > FE_FETCH_R                                       ~9      $8, !2, ->24
         11    >   ASSIGN                                                   !3, ~9
   13    12        ECHO                                                     !3
   14    13        IS_SMALLER                                               1, !2
         14      > JMPZ                                                     ~11, ->20
         15    >   ROPE_INIT                                     3  ~13     '+%28'
         16        ROPE_ADD                                      1  ~13     ~13, !2
         17        ROPE_END                                      2  ~12     ~13, '%29'
         18        QM_ASSIGN                                        ~15     ~12
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~15     ''
         21    >   ECHO                                                     ~15
   15    22        ECHO                                                     '%0A'
   12    23      > JMP                                                      ->10
         24    >   FE_FREE                                                  $8
   16    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.33 ms | 941 KiB | 18 Q