php-src/Zend/tests/bug63882.phpt
Ilija Tovilo 82479e89d0
Throw error for recursive comparison, instead of fatal (#14989)
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
2024-07-22 15:53:41 +02:00

21 lines
371 B
PHP

--TEST--
Bug #63882 (zend_std_compare_objects crash on recursion)
--FILE--
<?php
class Test { public $x = 5; }
$testobj1 = new Test;
$testobj2 = new Test;
$testobj1->x = $testobj1;
$testobj2->x = $testobj2;
try {
var_dump($testobj1 == $testobj2);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Nesting level too deep - recursive dependency?