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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user