summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index aeee738af8..050744b6b5 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -519,6 +519,11 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
if (arg_info->allow_null) {
string_printf(str, "or NULL ");
}
+ } else if (arg_info->array_type_hint) {
+ string_printf(str, "array ");
+ if (arg_info->allow_null) {
+ string_printf(str, "or NULL ");
+ }
}
if (arg_info->pass_by_reference) {
string_write(str, "&", sizeof("&")-1);
@@ -1716,6 +1721,20 @@ ZEND_METHOD(reflection_parameter, getClass)
}
/* }}} */
+/* {{{ proto public bool ReflectionParameter::isArray()
+ Returns whether parameter MUST be an array */
+ZEND_METHOD(reflection_parameter, isArray)
+{
+ reflection_object *intern;
+ parameter_reference *param;
+
+ METHOD_NOTSTATIC_NUMPARAMS(0);
+ GET_REFLECTION_OBJECT_PTR(param);
+
+ RETVAL_BOOL(param->arg_info->array_type_hint);
+}
+/* }}} */
+
/* {{{ proto public bool ReflectionParameter::allowsNull()
Returns whether NULL is allowed as this parameters's value */
ZEND_METHOD(reflection_parameter, allowsNull)
@@ -3852,6 +3871,7 @@ static zend_function_entry reflection_parameter_functions[] = {
ZEND_ME(reflection_parameter, getName, NULL, 0)
ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0)
ZEND_ME(reflection_parameter, getClass, NULL, 0)
+ ZEND_ME(reflection_parameter, isArray, NULL, 0)
ZEND_ME(reflection_parameter, allowsNull, NULL, 0)
ZEND_ME(reflection_parameter, isOptional, NULL, 0)
ZEND_ME(reflection_parameter, isDefaultValueAvailable, NULL, 0)