3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = Array ( 0 => Array ( 0 => 'Red', 1 => 'Steel' ), 1 => Array ( 0 => 'Red', 1 => 'Wood' ) , 2 => Array ( 0 => 'Blue', 1 => 'Wood' ) ); $colors = array_count_values(array_column($arr, 0)); $materials = array_count_values(array_column($arr, 1)); print_r($colors); print_r($materials);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RUGQ9
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $colors, !2 = $materials
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    7     1        INIT_FCALL                                                   'array_count_values'
          2        INIT_FCALL                                                   'array_column'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     0
          5        DO_ICALL                                             $4      
          6        SEND_VAR                                                     $4
          7        DO_ICALL                                             $5      
          8        ASSIGN                                                       !1, $5
    8     9        INIT_FCALL                                                   'array_count_values'
         10        INIT_FCALL                                                   'array_column'
         11        SEND_VAR                                                     !0
         12        SEND_VAL                                                     1
         13        DO_ICALL                                             $7      
         14        SEND_VAR                                                     $7
         15        DO_ICALL                                             $8      
         16        ASSIGN                                                       !2, $8
   10    17        INIT_FCALL                                                   'print_r'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                                     
   11    20        INIT_FCALL                                                   'print_r'
         21        SEND_VAR                                                     !2
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
198.52 ms | 3072 KiB | 16 Q