3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['KRA_category'=>'Business'], ['KRA_category'=>'Business'], ['KRA_category'=>'People'], ['KRA_category'=>'Business'], ['KRA_category'=>'Business'], ['KRA_category'=>'Business'] ]; foreach ($array as ['KRA_category' => $value]) { $result[$value] = ($result[$value] ?? -1) + 1; } var_export(array_filter($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/N5I9OY
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $value, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $4      !0, ->13
          2    > > FE_FETCH_R                                               $4, $5, ->13
          3    >   FETCH_LIST_R                                     $6      $5, 'KRA_category'
          4        ASSIGN                                                   !1, $6
          5        FREE                                                     $5
   13     6        FETCH_DIM_IS                                     ~9      !2, !1
          7        COALESCE                                         ~10     ~9
          8        QM_ASSIGN                                        ~10     -1
          9        ADD                                              ~11     ~10, 1
         10        ASSIGN_DIM                                               !2, !1
         11        OP_DATA                                                  ~11
   12    12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $4
   15    14        INIT_FCALL                                               'var_export'
         15        INIT_FCALL                                               'array_filter'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $12     
         18        SEND_VAR                                                 $12
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.74 ms | 1011 KiB | 15 Q