In response to Scott Johnson's request for advice on variable functions,
I decided to run some benchmarks.
<rant>Writing benchmarks is easy. Yet I see a lot of blog entries and
mailing list postings asking, "Which is faster?" My first thought is always,
"Why didn't they test and find out?" If I ever have a question about how
something will work, I open up a temporary file, start coding, and run the
code. It's the easiest way to learn. Also, it teaches you to break things
into manageable, testable chunks, and this code often forms the basis for a
unit test later.</rant>
Back to benchmarking. Scott asks, "Is there a real difference between
call_user_func versus call_user_func_array and the variable function syntax
i.e. $function_name()?"
The short answer: absolutely. The long answer? Read on.