From: Dmitry Stogov Date: Fri, 28 Feb 2014 12:06:38 +0000 (+0400) Subject: Fixed closures in static methods X-Git-Tag: POST_PHPNG_MERGE~412^2~482 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08d9a4ffa22417a0e82bc4b8eb93c41c0efd2063;p=php Fixed closures in static methods --- diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index a16977b23a..a8f2be30c8 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;