3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = [4, 3, 4, 3, 1, 2, 1]; var_export( array_keys( array_intersect( array_count_values($numbers), [1] ) ) ); echo "\n---\n"; var_export( array_keys( array_filter( array_count_values($numbers), function($count) { return $count === 1; } ) ) ); echo "\n---\n"; // PHP7.4+ var_export( array_keys( array_filter( array_count_values($numbers), fn($count) => $count === 1 ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULAkV
function name:  (null)
number of ops:  45
compiled vars:  !0 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'var_export'
    4     2        INIT_FCALL                                               'array_keys'
    5     3        INIT_FCALL                                               'array_intersect'
    6     4        INIT_FCALL                                               'array_count_values'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
    7     8        SEND_VAL                                                 <array>
    5     9        DO_ICALL                                         $3      
    7    10        SEND_VAR                                                 $3
    4    11        DO_ICALL                                         $4      
    7    12        SEND_VAR                                                 $4
    3    13        DO_ICALL                                                 
   12    14        ECHO                                                     '%0A---%0A'
   13    15        INIT_FCALL                                               'var_export'
   14    16        INIT_FCALL                                               'array_keys'
   15    17        INIT_FCALL                                               'array_filter'
   16    18        INIT_FCALL                                               'array_count_values'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $6      
         21        SEND_VAR                                                 $6
   17    22        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
   19    23        SEND_VAL                                                 ~7
   15    24        DO_ICALL                                         $8      
   19    25        SEND_VAR                                                 $8
   14    26        DO_ICALL                                         $9      
   19    27        SEND_VAR                                                 $9
   13    28        DO_ICALL                                                 
   24    29        ECHO                                                     '%0A---%0A'
   26    30        INIT_FCALL                                               'var_export'
   27    31        INIT_FCALL                                               'array_keys'
   28    32        INIT_FCALL                                               'array_filter'
   29    33        INIT_FCALL                                               'array_count_values'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $11     
         36        SEND_VAR                                                 $11
   30    37        DECLARE_LAMBDA_FUNCTION                          ~12     [1]
   31    38        SEND_VAL                                                 ~12
   28    39        DO_ICALL                                         $13     
   31    40        SEND_VAR                                                 $13
   27    41        DO_ICALL                                         $14     
   31    42        SEND_VAR                                                 $14
   26    43        DO_ICALL                                                 
   33    44      > 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/ULAkV
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        IS_IDENTICAL                                     ~1      !0, 1
          2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULAkV
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        IS_IDENTICAL                                     ~1      !0, 1
          2      > RETURN                                                   ~1
   31     3*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.27 ms | 1020 KiB | 18 Q