Chaim is right. However, I used to have problems with array_count_values ββparameters. Therefore, if you already know what value you are checking, and do not need others. The cycle and counter can be faster. I would appreciate it.
EDIT
That is, if the array is less than 1000-10 000 elements. Then it is probably too small to make a difference.
source
share