Fixed closures in static methods

This commit is contained in:
Dmitry Stogov 2014-02-28 16:06:38 +04:00
parent a18a95f70a
commit 08d9a4ffa2

View 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;