1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

Fixed possible crash because of overriden error handler

This commit is contained in:
Dmitry Stogov
2008-09-17 13:08:54 +00:00
parent fcc0fdd125
commit df9b7a1fe0
2 changed files with 18 additions and 1 deletions
+16
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
+2 -1
View File
@@ -136,7 +136,8 @@ static zend_function *zend_closure_get_method(zval **object_ptr, char *method_na
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);
}
/* }}} */