3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array['addition'] = array(24, 12, 6); $array['subtraction'] = array(4, 3, 2); $array['multiplication'] = array(128, 32, 8); $array['division'] = array(4, 5, 6); $dups = array(); foreach($array as $key => $value){ $dups[$key] = array_count_values($value); } $currentHighestValue = 0; foreach($dups as $type => $value){ foreach($value as $key => $value){ if($value > $currentHighestValue){ $currentHighestValue = $value; $currentHighestType = $type; } } } print $currentHighestType;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 33
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 30
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 31
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 18
filename:       /in/9ZCrU
function name:  (null)
number of ops:  36
compiled vars:  !0 = $array, !1 = $dups, !2 = $value, !3 = $key, !4 = $currentHighestValue, !5 = $type, !6 = $currentHighestType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN_DIM                                               !0, 'addition'
          1        OP_DATA                                                  <array>
    5     2        ASSIGN_DIM                                               !0, 'subtraction'
          3        OP_DATA                                                  <array>
    6     4        ASSIGN_DIM                                               !0, 'multiplication'
          5        OP_DATA                                                  <array>
    7     6        ASSIGN_DIM                                               !0, 'division'
          7        OP_DATA                                                  <array>
   10     8        ASSIGN                                                   !1, <array>
   11     9      > FE_RESET_R                                       $12     !0, ->18
         10    > > FE_FETCH_R                                       ~13     $12, !2, ->18
         11    >   ASSIGN                                                   !3, ~13
   12    12        INIT_FCALL                                               'array_count_values'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $16     
         15        ASSIGN_DIM                                               !1, !3
         16        OP_DATA                                                  $16
   11    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $12
   17    19        ASSIGN                                                   !4, 0
   18    20      > FE_RESET_R                                       $18     !1, ->33
         21    > > FE_FETCH_R                                       ~19     $18, !2, ->33
         22    >   ASSIGN                                                   !5, ~19
   20    23      > FE_RESET_R                                       $21     !2, ->31
         24    > > FE_FETCH_R                                       ~22     $21, !2, ->31
         25    >   ASSIGN                                                   !3, ~22
   22    26        IS_SMALLER                                               !4, !2
         27      > JMPZ                                                     ~24, ->30
   23    28    >   ASSIGN                                                   !4, !2
   24    29        ASSIGN                                                   !6, !5
   20    30    > > JMP                                                      ->24
         31    >   FE_FREE                                                  $21
   18    32      > JMP                                                      ->21
         33    >   FE_FREE                                                  $18
   29    34        ECHO                                                     !6
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.99 ms | 1392 KiB | 15 Q