1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  Tweak behaviour of dynamic properties wrt error handlers
This commit is contained in:
Niels Dossche
2023-09-03 18:27:32 +02:00
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
--TEST--
OSS-Fuzz #61712 (assertion failure with error handler during binary op)
--FILE--
<?php
#[AllowDynamicProperties]
class C {
function error($_, $msg) {
echo $msg, "\n";
$this->a = 12345;
}
}
$c = new C;
set_error_handler([$c, 'error']);
$c->a %= 10;
var_dump($c->a);
?>
--EXPECT--
Undefined property: C::$a
int(5)

View File

@@ -1163,7 +1163,7 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_WARNING, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name));
}
retval = zend_hash_update(zobj->properties, name, &EG(uninitialized_zval));
retval = zend_hash_add(zobj->properties, name, &EG(uninitialized_zval));
}
} else if (zobj->ce->__get == NULL) {
retval = &EG(error_zval);