3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array['addition'] = array(24, 12, 6); $array['subtraction'] = array(4, 4, 2); $array['multiplication'] = array(128, 32, 8); $array['division'] = array(2, 1, 4); $dups = array(); foreach($array as $key => $value){ $dups[$key] = array_count_values($value); } print_r($dups); $currentHighestValue = 1; foreach($dups as $type => $value){ print $type; foreach($value as $key => $value){ if($value > $currentHighestValue){ $currentHighest = $type; } } } print $currentHighest;
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 = 24, Position 2 = 36
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 34
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 33
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 34
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 18
filename:       /in/BsM7Q
function name:  (null)
number of ops:  39
compiled vars:  !0 = $array, !1 = $dups, !2 = $value, !3 = $key, !4 = $currentHighestValue, !5 = $type, !6 = $currentHighest
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
   15    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   17    22        ASSIGN                                                   !4, 1
   18    23      > FE_RESET_R                                       $19     !1, ->36
         24    > > FE_FETCH_R                                       ~20     $19, !2, ->36
         25    >   ASSIGN                                                   !5, ~20
   19    26        ECHO                                                     !5
   20    27      > FE_RESET_R                                       $22     !2, ->34
         28    > > FE_FETCH_R                                       ~23     $22, !2, ->34
         29    >   ASSIGN                                                   !3, ~23
   22    30        IS_SMALLER                                               !4, !2
         31      > JMPZ                                                     ~25, ->33
   23    32    >   ASSIGN                                                   !6, !5
   20    33    > > JMP                                                      ->28
         34    >   FE_FREE                                                  $22
   18    35      > JMP                                                      ->24
         36    >   FE_FREE                                                  $19
   28    37        ECHO                                                     !6
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.92 ms | 1400 KiB | 17 Q