diff --git a/Zend/tests/closure_031.phpt b/Zend/tests/closure_031.phpt new file mode 100644 index 00000000000..dace4a4e737 --- /dev/null +++ b/Zend/tests/closure_031.phpt @@ -0,0 +1,16 @@ +--TEST-- +Closure 031: Closure properties with custom error handlers +--FILE-- +a); +?> +--EXPECT-- +Error: Closure object cannot have properties +NULL + diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index d4a80719bb5..7ada6274c08 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -140,7 +140,8 @@ static zend_function *zend_closure_get_method(zval **object_ptr, zstr method_nam static zval *zend_closure_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ { ZEND_CLOSURE_PROPERTY_ERROR(); - return NULL; + Z_ADDREF(EG(uninitialized_zval)); + return &EG(uninitialized_zval); } /* }}} */