3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ (object)['group' => 'a', 'other_col' => 'a'], (object)['group' => 'b', 'other_col' => 'a'], (object)['group' => 'a', 'other_col' => 'a'], (object)['group' => 'a', 'other_col' => 'a'], (object)['group' => 'c', 'other_col' => 'a'], ]; $groups = array_count_values(array_column($rows, 'group')); print_r($groups);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XiXec
function name:  (null)
number of ops:  23
compiled vars:  !0 = $rows, !1 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
    5     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    6     4        CAST                                          8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                ~3      ~5
    7     6        CAST                                          8  ~6      <array>
          7        ADD_ARRAY_ELEMENT                                ~3      ~6
    8     8        CAST                                          8  ~7      <array>
          9        ADD_ARRAY_ELEMENT                                ~3      ~7
    3    10        ASSIGN                                                   !0, ~3
   11    11        INIT_FCALL                                               'array_count_values'
         12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 'group'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !1, $10
   13    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.31 ms | 1399 KiB | 19 Q