com php-src: Fixed closures in static methods: Zend/zend_clos ures.c
| From: | Dmitry Stogov | Date: | Fri, 28 Feb 2014 12:06:38 +0000 |
| Subject: | com php-src: Fixed closures in static methods: Zend/zend_clos ures.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77771@lists.php.net to get a copy of this message | ||
Commit: 08d9a4ffa22417a0e82bc4b8eb93c41c0efd2063
Author: Dmitry Stogov <dmitry@zend.com> Fri, 28 Feb 2014 16:06:38 +0400
Parents: a18a95f70a5b52b916695fe180e6e9cab6e648cb
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=08d9a4ffa22417a0e82bc4b8eb93c41c0efd2063
Log:
Fixed closures in static methods
Changed paths:
M Zend/zend_closures.c
Diff:
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index a16977b..a8f2be3 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -473,7 +473,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
closure->func.common.scope = scope;
if (scope) {
closure->func.common.fn_flags |= ZEND_ACC_PUBLIC;
- if (this_ptr && (closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0) {
+ if (this_ptr && Z_TYPE_P(this_ptr) == IS_OBJECT &&
(closure->func..common.fn_flags & ZEND_ACC_STATIC) == 0) {
ZVAL_COPY(&closure->this_ptr, this_ptr);
} else {
closure->func.common.fn_flags |= ZEND_ACC_STATIC;