Re: [PHP-DEV] deep compare: nesting level too deep

2003-01-24 Thread Vaclav Dvorak
Moriyoshi Koizumi wrote:

On Sat, Jan 25, 2003 at 01:00:53AM +0100, Vaclav Dvorak wrote:


When I try to compare two "child" objects, PHP says: "Fatal error: 
Nesting level too deep - recursive dependency?". Well, yes, it _is_ a 
recursive dependency, but I don't see why PHP could not compare those 
objects anyway? Isn't it possible to tell whether two "names" reference 
the same "variable"? In fact, I'm comparing two references to the very 
same object, so the comparison could stop right there and not compare 
any members of the object.

Are you trying it with ZE2? Compare those objects with "===" not "==".
You'll get the exact result you've expected to see, I suppose.


No, it's PHP 4.2.2. If it's working like this in ZE2, I guess I'm 
satisfied. Trying to backport it would just waste time that can be spent 
on ZE2. :-) EOT.

Vaclav Dvorak  <[EMAIL PROTECTED]>


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] deep compare: nesting level too deep

2003-01-24 Thread Moriyoshi Koizumi
On Sat, Jan 25, 2003 at 01:00:53AM +0100, Vaclav Dvorak wrote:
> When I try to compare two "child" objects, PHP says: "Fatal error: 
> Nesting level too deep - recursive dependency?". Well, yes, it _is_ a 
> recursive dependency, but I don't see why PHP could not compare those 
> objects anyway? Isn't it possible to tell whether two "names" reference 
> the same "variable"? In fact, I'm comparing two references to the very 
> same object, so the comparison could stop right there and not compare 
> any members of the object.

Are you trying it with ZE2? Compare those objects with "===" not "==".
You'll get the exact result you've expected to see, I suppose.

Moriyoshi

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] deep compare: nesting level too deep

2003-01-24 Thread Vaclav Dvorak
Hello list,

I seem to have weird kinds of problems. I probably use some very unusual 
ways to program. I wonder if it's good or bad. ;-)

I have an object that has a member variable that is an array whose 
elements are references to other ("child") objects. Those child objects, 
in turn, hold a reference to the "parent" object.

When I try to compare two "child" objects, PHP says: "Fatal error: 
Nesting level too deep - recursive dependency?". Well, yes, it _is_ a 
recursive dependency, but I don't see why PHP could not compare those 
objects anyway? Isn't it possible to tell whether two "names" reference 
the same "variable"? In fact, I'm comparing two references to the very 
same object, so the comparison could stop right there and not compare 
any members of the object.

Vaclav Dvorak  <[EMAIL PROTECTED]>

PS: Any new ideas, opinions or fact on my foreach problem?


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php