I have code that adds values to an array. The array is later searched in another part of my code. The values that are added to the array are not necessarily unique, so it\'s
array_unique is about sqrt(n) times slower then in_array. But if you optimize the data and search again many times, it can be worth
sqrt(n)
PS: notice that
isset($arr[$key])
works faster then in_array providing the same result
in_array