mirror of
https://github.com/php/php-src.git
synced 2026-10-29 10:22:06 +08:00
RFC: https://wiki.php.net/rfc/partial_function_application_v2 Co-authored-by: Joe Watkins <krakjoe@php.net>
21 lines
447 B
PHP
21 lines
447 B
PHP
--TEST--
|
|
PFA errors: Can not fetch default parameter value for Closure::__invoke()
|
|
--FILE--
|
|
<?php
|
|
|
|
$f = function ($a, $b, $c = null) {};
|
|
|
|
$g = $f->__invoke(0, 0, ?);
|
|
echo "No error\n";
|
|
|
|
try {
|
|
$g = $f->__invoke(0, 0, ...);
|
|
} catch (Error $e) {
|
|
echo $e::class, ": ", $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
No error
|
|
ArgumentCountError: Closure::__invoke(): Argument #3 ($c) must be passed explicitly, because the default value is not known
|