mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

I don't understand the rationale of fatal erroring here. It seems this should properly unprotect the compared elements when returning up the stack. Related to GH-14980
21 lines
391 B
PHP
21 lines
391 B
PHP
--TEST--
|
|
Comparison of a recursive array throws a catchable error
|
|
--FILE--
|
|
<?php
|
|
$a = [&$a];
|
|
try {
|
|
$a === [[]];
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
[[]] === $a;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
var_dump($a === $a);
|
|
?>
|
|
--EXPECT--
|
|
Nesting level too deep - recursive dependency?
|
|
Nesting level too deep - recursive dependency?
|
|
bool(true)
|