mirror of
https://github.com/php/php-src.git
synced 2026-04-29 19:23:22 +02:00
d033d5c07a
The default value is part of the op_array in that case, but we have no way to access it. Fail gracefully.
28 lines
615 B
PHP
28 lines
615 B
PHP
--TEST--
|
|
Fetching default value of an internal trampoline function with userland arginfo
|
|
--FILE--
|
|
<?php
|
|
$closure = function ($b = 0) {};
|
|
$ro = new ReflectionObject($closure);
|
|
$rm = $ro->getMethod('__invoke');
|
|
echo $rm, "\n";
|
|
|
|
$rp = $rm->getParameters()[0];
|
|
var_dump($rp->isDefaultValueAvailable());
|
|
try {
|
|
var_dump($rp->getDefaultValue());
|
|
} catch (ReflectionException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Method [ <internal> public method __invoke ] {
|
|
|
|
- Parameters [1] {
|
|
Parameter #0 [ <optional> $b = <default> ]
|
|
}
|
|
}
|
|
|
|
bool(false)
|
|
Internal error: Failed to retrieve the default value
|