Simplify and modernize wc_print_r()

Replaces a call to call_user_func_array() with argument unpacking using the spread operator.
This commit is contained in:
Rodrigo Primo 2019-11-21 12:04:08 -03:00
parent 6cd08dc7bd
commit 49b1294494
1 changed files with 1 additions and 1 deletions

View File

@ -1826,7 +1826,7 @@ function wc_print_r( $expression, $return = false ) {
foreach ( $alternatives as $alternative ) { foreach ( $alternatives as $alternative ) {
if ( function_exists( $alternative['func'] ) ) { if ( function_exists( $alternative['func'] ) ) {
$res = call_user_func_array( $alternative['func'], $alternative['args'] ); $res = $alternative['func']( ...$alternative['args'] );
if ( $return ) { if ( $return ) {
return $res; return $res;
} }