Skip to content

Function call_user_func with native callback should implement same behavior as native function call #7057

@janbarasek

Description

@janbarasek

Bug report

When using the call_user_func() function, no detection of the passed type is performed as when the function is called directly.

Code snippet that reproduces the problem

https://phpstan.org/r/aefe7560-a80c-4207-a976-9ed696705b9b

// error
echo vsprintf('aa %s bb', call_user_func(function (): array { return ['a']; }));

// but ok
echo vsprintf('aa %s bb', (function (): array { return ['a']; })());

Expected output

Same input as in case of native callback.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions