Description
The following code:
<?php
class C {
public $b;
}
$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyProxy(function ($obj) {
$obj->b = 4;
throw new Exception();
});
try {
$reflector->initializeLazyObject($obj);
} catch (Exception $e) {
$reflector->getProperty('b')->skipLazyInitialization($obj);
}
?>
Resulted in this output:
php: /path/to/php-src/ext/reflection/php_reflection.c:6266: zim_ReflectionProperty_skipLazyInitialization: Assertion `zval_get_type(&(*(dst))) == 0 && "Lazy property should be UNDEF"' failed.
Aborted
Commit:
Configurations:
CC="gcc" CXX="g++" CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic
PHP Version
PHP 8.6.0-dev (cli) (built: Oct 15 2025 13:52:11) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies
Operating System
Ubuntu 22.04