Skip to content

Core dumped in Zend/zend_lazy_objects.c #15823

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
class C {
public int $a = 1;
}
function test(string $name, object $obj) {
var_dump($obj);
}
$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyGhost(function ($obj) {
throw new Error("initializer");
});
test('Proxy', $obj);
json_encode($obj, 0, 540);

Resulted in this output:

/php-src/Zend/zend_lazy_objects.c:627: HashTable *zend_lazy_object_get_properties(zend_object *): Assertion `!object->properties || object->properties == &zend_empty_array' failed.
Aborted (core dumped)

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions