[php-src] Issue #16053: Assertion failure in Zend/zend_hash.c
| From: | YuanchengJiang | Date: | Wed, 25 Sep 2024 14:40:48 +0000 |
| Subject: | [php-src] Issue #16053: Assertion failure in Zend/zend_hash.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247901@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/16053
Author: YuanchengJiang
### Description
The following code:
```php
<?php
class test
{
}
$x = new test;
$fusion = $x;
$arrays = array (
array(1 => "hello", "string" => $fusion, $heredoc),
);
$arr2 = array( 1 => "one", 2, "string" => "hello",
"array" => array("a", "b", "c"));
foreach($arrays as $arr1) {
var_dump( array_merge_recursive($arr1) );
var_dump( array_merge_recursive($arr1, $arr2) );
}
```
Resulted in this output:
```
/php-src/Zend/zend_hash.c:1091: zval *_zend_hash_index_add_or_update_i(HashTable *, zend_ulong, zval
*, uint32_t): Assertion `(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags &
(1<<6))' failed.
Aborted (core dumped)
```
### PHP Version
PHP 8.4.0-dev
### Operating System
ubuntu 22.04