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:
parent
6cd08dc7bd
commit
49b1294494
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue