Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
call_fuel_func_array()
  • As in changelog for 1.7 there is:
    Where relevant calls to `call_user_func_array()` have been changed to `call_fuel_func_array()`, our internal equivalent which is about 30% faster.




    is this sill a thing in php 7.x or performance of this function has been improve and could be potentially replaced for native function call ?
  • The point here is that if you know the number of arguments, calling the function directly is a lot faster than using call_user_func_array(), and this is what call_fuel_func_array() does. 

    This is still true today, although speed varies between PHP versions, and the method of solving it.

    Up to PHP 5.6, it is solved using a check on the number of arguments, and a switch() to call the method directly. From PHP 5.6 onwards, a variadic function call is used (which is faster than using switch).

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion