summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-07-23 10:51:19 +0200
committerOndřej Surý <ondrej@sury.org>2012-07-23 10:51:19 +0200
commit3365f28adf90110ca7475df889720fc244820f4b (patch)
tree5415edde3e396a93f05f887d9f07071871467bdf /ext/reflection/php_reflection.c
parentf0f8d7084aec4be5c07f02f2e29c2820f85c8315 (diff)
downloadphp-3365f28adf90110ca7475df889720fc244820f4b.tar.gz
Imported Upstream version 5.4.5upstream/5.4.5
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 1cf65cee1..ee76afbc0 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2561,7 +2561,8 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
*return_value = *precv->op2.zv;
INIT_PZVAL(return_value);
- if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) {
+ if ((Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT
+ && (Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) {
zval_copy_ctor(return_value);
}
zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC);
@@ -2922,6 +2923,14 @@ ZEND_METHOD(reflection_method, invokeArgs)
fcc.calling_scope = obj_ce;
fcc.called_scope = intern->ce;
fcc.object_ptr = object;
+
+ /*
+ * Copy the zend_function when calling via handler (e.g. Closure::__invoke())
+ */
+ if (mptr->type == ZEND_INTERNAL_FUNCTION &&
+ (mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
+ fcc.function_handler = _copy_function(mptr TSRMLS_CC);
+ }
result = zend_call_function(&fci, &fcc TSRMLS_CC);