What's faster in PHP, making a large switch statement, or setting up an array and looking up the key?
Now before you answer, I am well aware that for pure lookups the array is faster. But, this is assuming creating the array just once, then looking it up repeatedly.
But that's not what I'm doing - each run through the code is new, and the array will be used just once each time. So all the array hashes need to be calculated fresh each time, and I'm wondering if doing that setup is slower than simply having a switch
statement.