Skip to content

Assertion failure in zend_check_property_access due to static and instance property name conflict across inheritance (zend_object_handlers.c) #20177

Description

@vi3tL0u1s

Description

The following code:

<?php
class a {
    private static $prop1;
    private static $prop2;
    public function __construct() {
        $a = get_object_vars($this);
        
        $this->prop1 = 1;
        $this->prop2 = 2;
    }
}
class c extends a {
    public $prop1;
    protected $prop2;
}
$c = new c;
?>

Resulted in this output:

php: /path/to/php-src/Zend/zend_object_handlers.c:569: zend_check_property_access: Assertion `property_info->flags & (1 << 1)' failed.
Aborted

Commit:

e2da92b15c7

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions