3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayName = array(1,2,1,3,4,3,2,5); $values = array_unique($arrayName); Foreach($values as $val){ $count[$val] = count(array_keys($arrayName, $val)); } Var_dump($count);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/EGGJq
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arrayName, !1 = $values, !2 = $val, !3 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_unique'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    5     5      > FE_RESET_R                                       $7      !1, ->15
          6    > > FE_FETCH_R                                               $7, !2, ->15
    6     7    >   INIT_FCALL                                               'array_keys'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $9      
         11        COUNT                                            ~10     $9
         12        ASSIGN_DIM                                               !3, !2
         13        OP_DATA                                                  ~10
    5    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $7
    9    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.62 ms | 1438 KiB | 16 Q