3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array['addition'] = array(24, 12, 6); $array['subtraction'] = array(4, 4, 4); $array['multiplication'] = array(128, 32, 8); $array['division'] = array(4, 4, 6); $dups = array(); foreach($array as $key => $value){ $dups[$key] = array_count_values($value); } $currentHighestValue = 0; foreach($dups as $type => $value){ foreach($value as $v){ if($v > $currentHighestValue){ $currentHighestValue = $v; $currentHighestType = $type; } } } print $currentHighestType;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
Jump found. Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
Jump found. Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
Jump found. Position 1 = 21, Position 2 = 32
Branch analysis from position: 21
Jump found. Position 1 = 22, Position 2 = 32
Branch analysis from position: 22
Jump found. Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
Jump found. Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
Jump found. Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
Jump found. Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 29
Branch analysis from position: 30
Jump found. Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
Branch analysis from position: 32
Jump found. Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 18
filename:       /in/2PqWV
function name:  (null)
number of ops:  35
compiled vars:  !0 = $array, !1 = $dups, !2 = $value, !3 = $key, !4 = $currentHighestValue, !5 = $type, !6 = $v, !7 = $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                                       $13     !0, ->18
        10    > > FE_FETCH_R                                       ~14     $13, !2, ->18
        11    >   ASSIGN                                                   !3, ~14
  12    12        INIT_FCALL                                               'array_count_values'
        13        SEND_VAR                                                 !2
        14        DO_ICALL                                         $17     
        15        ASSIGN_DIM                                               !1, !3
        16        OP_DATA                                                  $17
        17      > JMP                                                      ->10
        18    >   FE_FREE                                                  $13
  17    19        ASSIGN                                                   !4, 0
  18    20      > FE_RESET_R                                       $19     !1, ->32
        21    > > FE_FETCH_R                                               $19, !2, ->32
        22    >   ASSIGN                                                   !5, ~20
  20    23      > FE_RESET_R                                       $22     !2, ->30
        24    > > FE_FETCH_R                                               $22, !6, ->30
  22    25    >   IS_SMALLER                                       ~23     !4, !6
        26      > JMPZ                                                     ~23, ->29
  23    27    >   ASSIGN                                                   !4, !6
  24    28        ASSIGN                                                   !7, !5
        29    > > JMP                                                      ->24
        30    >   FE_FREE                                                  $22
        31      > JMP                                                      ->21
        32    >   FE_FREE                                                  $19
  29    33        ECHO                                                     !7
        34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0