Skip to content

Assertion failure in zend_lazy_object_get_info triggered by setRawValueWithoutLazyInitialization() and newLazyGhost() #20657

@vi3tL0u1s

Description

@vi3tL0u1s

Description

The following code:

<?php
class C {
    public $a;
}
function test(string $name, object $obj) {
    $reflector = new ReflectionClass(C::class);
    $ale = new class($obj) {
        function __construct(public object $obj) {}
    };
    $reflector->getProperty('a')->setRawValueWithoutLazyInitialization($obj, $alue);
    $obj = $reflector->newLazyGhost(function ($obj) {});
    test('Ghost>isUn', $obj);
}

$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyProxy(function () {
    return-new C();
});
test('Proxy', $obj);

Resulted in this output:

php: /path/to/php-src/Zend/zend_lazy_objects.c:110: zend_lazy_object_get_info: Assertion `info' failed.
Aborted

Commit:

824c3891281bb4deb5a1aa245313a6c6b0ea786f

Build configuration:

CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" LDFLAGS="-fsanitize=address" ./buildconf --force && ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic --enable-mbstring --with-zlib

PHP Version

PHP 8.6.0-dev (cli) (built: Dec  6 2025 16:29:29) (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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions