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); } $currentHighest = 'addition'; foreach($dups as $type => $value){ foreach($value as $key => $value){ if($value > $currentHighest){ $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 = 21, Position 2 = 32
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 32
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 29
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 18
filename:       /in/6hBn8
function name:  (null)
number of ops:  35
compiled vars:  !0 = $array, !1 = $dups, !2 = $value, !3 = $key, !4 = $currentHighest, !5 = $type
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                                       $11     !0, ->18
         10    > > FE_FETCH_R                                       ~12     $11, !2, ->18
         11    >   ASSIGN                                                   !3, ~12
   12    12        INIT_FCALL                                               'array_count_values'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $15     
         15        ASSIGN_DIM                                               !1, !3
         16        OP_DATA                                                  $15
   11    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $11
   15    19        ASSIGN                                                   !4, 'addition'
   16    20      > FE_RESET_R                                       $17     !1, ->32
         21    > > FE_FETCH_R                                       ~18     $17, !2, ->32
         22    >   ASSIGN                                                   !5, ~18
   17    23      > FE_RESET_R                                       $20     !2, ->30
         24    > > FE_FETCH_R                                       ~21     $20, !2, ->30
         25    >   ASSIGN                                                   !3, ~21
   18    26        IS_SMALLER                                               !4, !2
         27      > JMPZ                                                     ~23, ->29
   19    28    >   ASSIGN                                                   !4, !5
   17    29    > > JMP                                                      ->24
         30    >   FE_FREE                                                  $20
   16    31      > JMP                                                      ->21
         32    >   FE_FREE                                                  $17
   24    33        ECHO                                                     !4
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.5 ms | 1400 KiB | 15 Q