[php-src] Issue #20564: Assertion failure in zendlex() during re-entrant __call() execution triggered by eval() and autoloader registration
| From: | vi3tL0u1s | Date: | Sun, 23 Nov 2025 06:27:20 +0000 |
| Subject: | [php-src] Issue #20564: Assertion failure in zendlex() during re-entrant __call() execution triggered by eval() and autoloader registration | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251286@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20564
Author: vi3tL0u1s
### Description
The following code:
```php
<?php
class A {
function __call($method, $args) {
spl_autoload_register(('A::mj'));
eval('const T_8 = <<<ENDOFSTRING
This is a test string
ENDOFSTRING;?>');
array_map('R::b', []);
}
function __destruct() {
$this->close();
}
}
$obx = new A(1);
```
Resulted in this output:
```
php: /path/to/php-src/Zend/zend_compile.c:2037: int zendlex(zend_parser_stack_elem *): Assertion
`!(executor_globals.exception) || ret == T_ERROR' failed.
Aborted
```
Commit:
```
56dd321ec7bc93149cba461ab6059b5e5b5dc8e0
```
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
```plain
PHP 8.6.0-dev (cli) (built: Nov 23 2025 13:25:26) (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