[php-src] Issue #11348: Closure created from magic method does not accept named arguments
| From: | danog | Date: | Tue, 30 May 2023 14:27:09 +0000 |
| Subject: | [php-src] Issue #11348: Closure created from magic method does not accept named arguments | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244572@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11348
Author: danog
### Description
The following code:
```php
<?php
class a {
public function __call($name, $args) { var_dump($args); }
}
$a = new a;
$a->test(a: 123);
$a->test(...)(a: 123);
```
Resulted in this output:
```
array(1) {
["a"]=>
int(123)
}
PHP Fatal error: Uncaught Error: Unknown named parameter $a in
/home/daniil/repos/MadelineProto/a.php:8
Stack trace:
#0 {main}
thrown in /home/daniil/repos/MadelineProto/a.php on line 8
```
But I expected this output instead:
```
array(1) {
["a"]=>
int(123)
}
array(1) {
["a"]=>
int(123)
}
```
### PHP Version
8.2.6
### Operating System
Arch linux