Is there a scenario where array_search is faster than a consecutive array_flip and direct lookup?
<p>Imagine you were to search an array of N elements and perform Y Searches on the array values to find the corresponding keys; you can either do Y <code>array_search</code>'s or do one <code>array_flip</code> and Y direct lookups. Why is the first method alot slower than the second method? Is there a scenario where the first method becomes faster than the second one?
You can assume that keys and values are unique</p>
