]> granicus.if.org Git - php/commitdiff
Fixed closures in static methods
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 12:06:38 +0000 (16:06 +0400)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 12:06:38 +0000 (16:06 +0400)
Zend/zend_closures.c

index a16977b23a0b8533037cbe1386e89bb3ceaf32fc..a8f2be30c867f7a54d3978781604ea43ae13cda9 100644 (file)
@@ -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;