Fixed possible crash because of overriden error handler

This commit is contained in:
Dmitry Stogov 2008-09-17 13:10:08 +00:00
parent 7fe09faebd
commit d083b068ce
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,16 @@
--TEST--
Closure 031: Closure properties with custom error handlers
--FILE--
<?php
function foo($errno, $errstr, $errfile, $errline) {
echo "Error: $errstr\n";
}
set_error_handler('foo');
$foo = function() {
};
var_dump($foo->a);
?>
--EXPECT--
Error: Closure object cannot have properties
NULL

View file

@ -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);
}
/* }}} */