diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-10-26 15:01:36 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-10-26 15:01:36 +0000 |
commit | e5c7fae82cdff7086fb14b5de78a70d55ec73955 (patch) | |
tree | 3ba08fbdcea4bf323d333579c667b3045e4bfc80 /ext/reflection/php_reflection.c | |
parent | 1f191e4d2b41222834a3eda419dcc314a69dd2f4 (diff) | |
download | php-git-e5c7fae82cdff7086fb14b5de78a70d55ec73955.tar.gz |
- Added ReflectionParameter::canBePassedByValue().
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 467b965ced..67fc992ead 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2519,6 +2519,23 @@ ZEND_METHOD(reflection_parameter, isPassedByReference) } /* }}} */ +/* {{{ proto public bool ReflectionParameter::canBePassedByValue() + Returns whether this parameter can be passed by value */ +ZEND_METHOD(reflection_parameter, canBePassedByValue) +{ + reflection_object *intern; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + GET_REFLECTION_OBJECT_PTR(param); + + /* true if it's ZEND_SEND_BY_VAL or ZEND_SEND_PREFER_REF */ + RETVAL_BOOL(param->arg_info->pass_by_reference != ZEND_SEND_BY_REF); +} +/* }}} */ + /* {{{ proto public bool ReflectionParameter::getPosition() Returns whether this parameter is an optional parameter */ ZEND_METHOD(reflection_parameter, getPosition) @@ -5901,6 +5918,7 @@ static const zend_function_entry reflection_parameter_functions[] = { ZEND_ME(reflection_parameter, __toString, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getName, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, isPassedByReference, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, canBePassedByValue, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getDeclaringFunction, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getDeclaringClass, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getClass, arginfo_reflection__void, 0) |