mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00

New fix for bug #78263. This is special-cased elsewhere in the engine, so we need to mirror it here.
17 lines
372 B
PHP
17 lines
372 B
PHP
--TEST--
|
|
Bug #78263: Handling of self-referential array special case
|
|
--FILE--
|
|
<?php
|
|
|
|
// The case of a directly self-referential array is special and will
|
|
// be treated as a proper reference despite rc=1 during array copying.
|
|
$a = [&$a];
|
|
$b = [$a];
|
|
unset($a);
|
|
|
|
var_dump(ReflectionReference::fromArrayElement($b[0], 0));
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(ReflectionReference)#1 (0) {
|
|
}
|