Skip to content

[Bug]: call() can lead to PHP fatal error when arguments are mixed #2014

@stloyd

Description

@stloyd

What happened?

Mixing types of parameters will lead to a fatal error.

We should either:

  1. Enforce check if parameter has numeric keys and $refAlias is an integer,
  2. Enforce parameters to have only string keys and $refAlias to be a string,

Option 1 still has a problem from the second point, where the order of parameters will not match the function definition, either leading to invalid results or to deprecation warnings.

How to reproduce?

call('implode', ['separator' => ',']) // fatal
call('implode', [',']) // possible deprecation (wrong parameters order)

Data required to reproduce bug locally

No response

Version

0.27

Relevant error output

In CallUserFunc.php line 50:
                                                                        
  Cannot use positional argument after named argument during unpacking

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions