From 08d9a4ffa22417a0e82bc4b8eb93c41c0efd2063 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 28 Feb 2014 16:06:38 +0400 Subject: [PATCH] Fixed closures in static methods --- Zend/zend_closures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.50.1