diff options
author | Felipe Pena <felipensp@gmail.com> | 2012-06-23 15:16:20 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2012-06-23 15:16:20 -0300 |
commit | 1fc5659ebd6f2898ab474087f7877bcc4e774403 (patch) | |
tree | a7dd979b98de13941e48058ae1fd4f93815f0ee5 | |
parent | 7d900356e9de66619ca73eb6111ea1759c0367f1 (diff) | |
parent | 5e36306feb8ce2b43eb494d5c486fd341b0a1ea7 (diff) | |
download | php-git-1fc5659ebd6f2898ab474087f7877bcc4e774403.tar.gz |
Merge branch 'PHP-5.4'
* PHP-5.4:
- Improved fix for #62384
-rw-r--r-- | ext/reflection/php_reflection.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index ab5b15cbd4..ee76afbc02 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2925,12 +2925,10 @@ ZEND_METHOD(reflection_method, invokeArgs) fcc.object_ptr = object; /* - * Closure::__invoke() actually expects a copy of zend_function, so that it - * frees it after the invoking. + * Copy the zend_function when calling via handler (e.g. Closure::__invoke()) */ - if (obj_ce == zend_ce_closure && object && - strlen(mptr->common.function_name) == sizeof(ZEND_INVOKE_FUNC_NAME)-1 && - memcmp(mptr->common.function_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0) { + 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); } |