Bug #6239 Updated: object comparison w circular references leads to crash
| From: | jmoore@php.net | Date: | Sat, 28 Apr 2001 16:59:29 +0000 |
| Subject: | Bug #6239 Updated: object comparison w circular references leads to crash | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52720@lists.php.net to get a copy of this message | ||
ID: 6239
Updated by: jmoore
Reported By: waldschrott@php.net
Status: Open
Bug Type: Reproduceable crash
PHP Version: 4.0 Latest CVS (18/08/2000)
Assigned To:
Comments:
<?php
class object1 {
var $a;
var $b;
var $c;
}
$obj = new object1();
$obj2 = new object1();
$obj->a='1';
$obj->b='2';
$obj2->b='2';
$obj2->a='1';
$obj2->c=&$obj;
$obj->c=&$obj2;
echo ($obj==$obj2)?1:2;
echo ($obj===$obj2)?1:2;
?>
still causes a stack overflow error. Perhaps we need to limit the depth the comparison follows too.
Previous Comments:
---------------------------------------------------------------------------
[2000-12-30 12:04:15] sniper@php.net
And crashes with Linux too..
--Jani
---------------------------------------------------------------------------
[2000-11-27 06:22:51] waldschrott@php.net
no, still crashes w latest cvs
---------------------------------------------------------------------------
[2000-11-27 05:25:07] sniper@php.net
Isn't this fixed already?
--Jani
---------------------------------------------------------------------------
[2000-08-18 17:01:17] stas@php.net
Confirmed on latest CVS. Will look into it.
---------------------------------------------------------------------------
[2000-08-18 11:44:10] waldschrott@php.net
got another one ;)
of course this example is *extremely* different from my
example and I don´t know how we could handle circular
references in ordered and unordered comparisions with ease,
but *it should not crash* (taken from zeev) although it´d
expect it to... :)
$obj->a='1';
$obj->b='2';
$obj2->b='2';
$obj2->a='1';
$obj2->c=&$obj;
$obj->c=&$obj2;
echo $obj==$obj2;
echo $obj===$obj2;
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6239&edit=2