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 = $materials = array(); foreach ($arr as $a){ $colors[] = $a[0]; $materials[] = $a[1]; } $colors = array_count_values($colors); $materials = array_count_values($materials); print_r($colors); print_r($materials);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/DQI2K
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr, !1 = $colors, !2 = $materials, !3 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    7     1        ASSIGN                                               ~5      !2, <array>
          2        ASSIGN                                                       !1, ~5
    8     3      > FE_RESET_R                                           $7      !0, ->12
          4    > > FE_FETCH_R                                                   $7, !3, ->12
    9     5    >   FETCH_DIM_R                                          ~9      !3, 0
          6        ASSIGN_DIM                                                   !1
          7        OP_DATA                                                      ~9
   10     8        FETCH_DIM_R                                          ~11     !3, 1
          9        ASSIGN_DIM                                                   !2
         10        OP_DATA                                                      ~11
    8    11      > JMP                                                          ->4
         12    >   FE_FREE                                                      $7
   13    13        INIT_FCALL                                                   'array_count_values'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                             $12     
         16        ASSIGN                                                       !1, $12
   14    17        INIT_FCALL                                                   'array_count_values'
         18        SEND_VAR                                                     !2
         19        DO_ICALL                                             $14     
         20        ASSIGN                                                       !2, $14
   16    21        INIT_FCALL                                                   'print_r'
         22        SEND_VAR                                                     !1
         23        DO_ICALL                                                     
   17    24        INIT_FCALL                                                   'print_r'
         25        SEND_VAR                                                     !2
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
211.64 ms | 3069 KiB | 15 Q