3v4l.org

run code in 500+ PHP versions simultaneously
<?php $n = 12; $array = array_map(fn($v) => array_sum(str_split($v)), range(1, $n)); $winningGroupCounts = array_count_values(array_count_values($array)); echo "number of largest winning group(s): " . $winningGroupCounts[max(array_keys($winningGroupCounts))];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sRWoQ
function name:  (null)
number of ops:  28
compiled vars:  !0 = $n, !1 = $array, !2 = $winningGroupCounts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 12
    4     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          3        SEND_VAL                                                     ~4
          4        INIT_FCALL                                                   'range'
          5        SEND_VAL                                                     1
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $5      
          8        SEND_VAR                                                     $5
          9        DO_ICALL                                             $6      
         10        ASSIGN                                                       !1, $6
    5    11        INIT_FCALL                                                   'array_count_values'
         12        INIT_FCALL                                                   'array_count_values'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                             $8      
         15        SEND_VAR                                                     $8
         16        DO_ICALL                                             $9      
         17        ASSIGN                                                       !2, $9
    6    18        INIT_FCALL                                                   'max'
         19        INIT_FCALL                                                   'array_keys'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                             $11     
         22        SEND_VAR                                                     $11
         23        DO_ICALL                                             $12     
         24        FETCH_DIM_R                                          ~13     !2, $12
         25        CONCAT                                               ~14     'number+of+largest+winning+group%28s%29%3A+', ~13
         26        ECHO                                                         ~14
         27      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sRWoQ
function name:  {closure:/in/sRWoQ:4}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'array_sum'
          2        INIT_FCALL                                                   'str_split'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $1      
          5        SEND_VAR                                                     $1
          6        DO_ICALL                                             $2      
          7      > RETURN                                                       $2
          8*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.06 ms | 1894 KiB | 20 Q