summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-31 14:02:35 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-31 14:03:54 +0200
commitb4196ae9dfb345f0fd52084d5574d60c49139dc7 (patch)
treed7f21f71223f22b94d6d9c27a8d46c1f9b6ca417 /ext/reflection/php_reflection.c
parentbef20d47afbb1afae6217fd914172313ad2236dd (diff)
downloadphp-git-b4196ae9dfb345f0fd52084d5574d60c49139dc7.tar.gz
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.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index a24d72c747..016851e9e5 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -667,7 +667,10 @@ static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_
if (!required) {
if (fptr->type == ZEND_INTERNAL_FUNCTION) {
smart_str_appends(str, " = ");
- if (((zend_internal_arg_info*)arg_info)->default_value) {
+ /* TODO: We don't have a way to fetch the default value for an internal function
+ * with userland arg info. */
+ if (has_internal_arg_info(fptr)
+ && ((zend_internal_arg_info*)arg_info)->default_value) {
smart_str_appends(str, ((zend_internal_arg_info*)arg_info)->default_value);
} else {
smart_str_appends(str, "<default>");