Result: Discarded
The test labeled "call_user_func_array()" was the faster by 0.0548 seconds, (4.837% faster)
The call_user_func_array() test took 1.0786 seconds.
The fcall test took 1.1334 seconds.
Nitty-Gritty
Each test case ran 20 random code order iterations consisting of 286,937 loops for a total of 5,738,740 runs.
- Line execution difference (0.000010) milliseconds.
- Avg difference (2.741) milliseconds per 286,937 loops.
- Total difference 54.82 milliseconds for 5,738,740 loops
The iteration variablity for Code 1 was (6.6132) milliseconds and Code 2 was (4.1782) milliseconds. The lower and the closer together there values are the more accurate the results are.
Code
The first test, "fcall", was:
/* function do_something($i) { for ($i = 0; $i < 20; $i++) $GLOBALS['dummy'] + $i; } */ do_something(74);
The second test, "call_user_func_array()", was:
/* function do_something($i) { for ($i = 0; $i < 20; $i++) $GLOBALS['dummy'] + $i; } */ call_user_func_array('do_something', array(74));