Skip to content

PHP 8 introduced breaking change to call_user_func_array() #28

@jairoprez

Description

@jairoprez

See https://bugs.php.net/bug.php?id=80531.

That function is being used here https://github.com/brightnucleus/shortcodes/blob/master/src/ShortcodeManager.php#L383 and it is causing the Unknown named parameter error in a project where this component for shortcodes is being used.

Solution: passing the second parameter to call_user_func_array() through array_values() so that it doesn't have keys that would be treated as named parameters.

if ( is_callable( $class ) ) {
    $class = call_user_func_array( $class, array_values( $args ) );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions