Closed YuanchengJiang closed 1 month ago
At least PHP-8.3 is affected by this, too.
Smaller reproducer:
<?php
class test
{
}
$x = new test;
$arr1 = array("string" => $x);
$arr2 = array("string" => "hello");
var_dump($x);
var_dump(array_merge_recursive($arr1, $arr2));
array_merge_recursive()
assumes that the result of convert_to_array($x)
has RC=1, which is not always the case.
Fixed by https://github.com/php/php-src/pull/16061.
Thank you @YuanchengJiang!
Description
The following code:
Resulted in this output:
PHP Version
PHP 8.4.0-dev
Operating System
ubuntu 22.04