-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fetching default value of internal function with userland arginfo
"Fix" in the sense of "not crash". We aren't able to actually display the default value for this case, as there's no way to fetch the relevant information right now.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
ext/reflection/tests/default_value_internal_userland_arginfo.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--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"; | ||
?> | ||
--EXPECT-- | ||
Method [ <internal> public method __invoke ] { | ||
|
||
- Parameters [1] { | ||
Parameter #0 [ <optional> $b = <default> ] | ||
} | ||
} |