Skip to content

Replace call_user_func() with variable functionsĀ #2714

@ozh

Description

@ozh

Apparently, call_user_func() is slow. References:

We're using a couple (functions-l10n.php and functions-plugins.php as of writing) so the idea would be to replace them:

// before : 
call_user_func( $function1 );
call_user_func( $function2, $param );
// after :
$function1();
$function2( $param );

While at it, an is_callable() check before calling would be nice, to ensure the function is actually callable when it's user defined (plugins) (and make sure the cases of calling something callable and not callable are covered in a unit test)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions