[php-src] Issue #20861: Zend GC assertion failure in gc_check_possible_root_no_ref with lazy proxy

[email protected] (vi3tL0u1s)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/20861
Author: vi3tL0u1s

### Description

The following code:

```php
<?php
class A {
    public $_;
    public function __get($n) {
        global $obj;
        $obj->f =& $this->b;
        static $a = $a;
        foreach (get_defined_vars() as $k => $v) {}
        foreach (get_defined_vars() as $k => $v) {}
    }
}
class B extends A {}
$rc = new ReflectionClass(B::class);
$obj = $rc->newLazyProxy(fn() => new A);
$rc->initializeLazyObject($obj)->p;
```

Resulted in this output:
```
php: /path/to/php-src/Zend/zend_gc.h:105: gc_check_possible_root_no_ref: Assertion `(ref)->gc.u.type_info != (10 | ((1<<4) << 0))' failed.
Aborted
```

### Commit

```
643cf6253e5
```

### Configurations

```bash
CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic
```


### PHP Version

```plain
PHP 8.6.0-dev (cli) (built: Jan  8 2026 01:22:30) (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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.