summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorHannes Magnusson <bjori@php.net>2011-08-16 10:44:47 +0000
committerHannes Magnusson <bjori@php.net>2011-08-16 10:44:47 +0000
commit550980cfe58f6c2c935079f10eaabc5c6c271cea (patch)
treef4b7b1683b33c9102ddad9853119bfa3b788106a /ext/reflection/php_reflection.c
parent4a51ea4b81f2e3bc812ebd2b7ef9e6b4b295f1bf (diff)
downloadphp-git-550980cfe58f6c2c935079f10eaabc5c6c271cea.tar.gz
Callable typehint following the rules of is_callable($arg, false);
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 9f770360d3..3dfd2f276b 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2383,6 +2383,22 @@ ZEND_METHOD(reflection_parameter, isArray)
}
/* }}} */
+/* {{{ proto public bool ReflectionParameter::isCallable()
+ Returns whether parameter MUST be callable */
+ZEND_METHOD(reflection_parameter, isCallable)
+{
+ reflection_object *intern;
+ parameter_reference *param;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+ GET_REFLECTION_OBJECT_PTR(param);
+
+ RETVAL_BOOL(param->arg_info->type_hint == IS_CALLABLE);
+}
+/* }}} */
+
/* {{{ proto public bool ReflectionParameter::allowsNull()
Returns whether NULL is allowed as this parameters's value */
ZEND_METHOD(reflection_parameter, allowsNull)
@@ -5827,6 +5843,7 @@ static const zend_function_entry reflection_parameter_functions[] = {
ZEND_ME(reflection_parameter, getDeclaringClass, arginfo_reflection__void, 0)
ZEND_ME(reflection_parameter, getClass, arginfo_reflection__void, 0)
ZEND_ME(reflection_parameter, isArray, arginfo_reflection__void, 0)
+ ZEND_ME(reflection_parameter, isCallable, arginfo_reflection__void, 0)
ZEND_ME(reflection_parameter, allowsNull, arginfo_reflection__void, 0)
ZEND_ME(reflection_parameter, getPosition, arginfo_reflection__void, 0)
ZEND_ME(reflection_parameter, isOptional, arginfo_reflection__void, 0)