3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => "556878", 1 => "12345", 2 => "12345", 3 => "234567", 4 => "45673", 5 => "45673", ]; $n = 2; $result = array_keys(array_intersect(array_count_values($arr), [$n])); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIgCD
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $n, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, 2
   12     2        INIT_FCALL                                               'array_keys'
          3        INIT_FCALL                                               'array_intersect'
          4        INIT_FCALL                                               'array_count_values'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        INIT_ARRAY                                       ~6      !1
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   14    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.75 ms | 1002 KiB | 17 Q