diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-10-14 12:07:04 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-10-14 16:15:27 +0200 |
commit | 1b5b21539f8f12e6114bd4852438101c8989eabc (patch) | |
tree | 5b0670bd6bd80af3b38c4641439f7722e538f881 /ext/reflection/php_reflection.c | |
parent | 666db28ef25a166bb01c129316ecb7fec1e92532 (diff) | |
download | php-git-php-7.0.0RC5.tar.gz |
Do not create a fake Closure for real Closuresphp-7.0.0RC5
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a095120e18..df905bf5cc 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1762,7 +1762,12 @@ ZEND_METHOD(reflection_function, getClosure) } GET_REFLECTION_OBJECT_PTR(fptr); - zend_create_fake_closure(return_value, fptr, NULL, NULL, NULL); + if (!Z_ISUNDEF(intern->obj)) { + /* Closures are immutable objects */ + ZVAL_COPY(return_value, &intern->obj); + } else { + zend_create_fake_closure(return_value, fptr, NULL, NULL, NULL); + } } /* }}} */ |