Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] === on objects fails with recursion! WTH? [RSS Feed]

#1 Nov. 1, 2005 15:03:41

Amin A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] === on objects fails with recursion! WTH?


if ($object1===$object2)

does a recursive check!
"Fatal error: Nesting level too deep - recursive dependency?"
Whats going on?I've go lots of object references all highly recursive and I justsometimes need to check if two objects are the same object i.e. theyhave the same storage address; I don't need to (and can't afford thetime) to recursively check every field.Is there a ==== instead that REALLY does what it seems === is trying tofake, presumably to cover up all the object copying that is normallygoing on but that I've managed to avoid?Sam

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

Offline

#2 Nov. 1, 2005 15:24:09

Wez F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] === on objects fails with recursion! WTH?


I proposed a patch to fix this a while back (at least a year ago).

--Wez.

On 11/1/05, Amin Azez <> wrote:
> if ($object1===$object2)
>
> does a recursive check!
> "Fatal error: Nesting level too deep - recursive dependency?"
> Whats going on?
>
> I've go lots of object references all highly recursive and I just
> sometimes need to check if two objects are the same object i.e. they
> have the same storage address; I don't need to (and can't afford the
> time) to recursively check every field.
>
> Is there a ==== instead that REALLY does what it seems === is trying to
> fake, presumably to cover up all the object copying that is normally
> going on but that I've managed to avoid?
>
> Sam
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>

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

Offline

#3 Nov. 1, 2005 15:42:15

Jochem M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] === on objects fails with recursion! WTH?


this is a php4-only problem right?
(or is the little test below insufficient to test the stated problem?)

THIS:
----------------------
php -r '
class A { public $b; function __construct(B $b) { $this->b = $b;
$b->setA($this); } }
class B { public $a; function setA(A $a) { $this->a = $a; } }

$y = new B; $x = new A($y);
$z = $x;
$clone = clone $x;
var_dump(($x === $z), ($x === $clone), ($x == $z), ($x == $clone));
'

RETURNS (php5.0.4):
----------------------
bool(true)
bool(false)
bool(true)
bool(true)


Wez Furlong wrote:I proposed a patch to fix this a while back (at least a year ago).

--Wez.

On 11/1/05, Amin Azez <> wrote:if ($object1===$object2)

does a recursive check!
"Fatal error: Nesting level too deep - recursive dependency?"
Whats going on?

I've go lots of object references all highly recursive and I just
sometimes need to check if two objects are the same object i.e. they
have the same storage address; I don't need to (and can't afford the
time) to recursively check every field.

Is there a ==== instead that REALLY does what it seems === is trying to
fake, presumably to cover up all the object copying that is normally
going on but that I've managed to avoid?

Sam

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

Offline

#4 Nov. 1, 2005 15:46:44

Amin A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] === on objects fails with recursion! WTH?


Wez Furlong wrote:I proposed a patch to fix this a while back (at least a year ago).I'm trying to file it as a bug, but bugs.php.net seems to be down,probably busy recusrively comparing objects or something.Could you post it (or a URL) please so I can patch.
Had you already filed this as a bug report?

Sadly searches on === reveal nothing.


Sam--Wez.

On 11/1/05, Amin Azez <> wrote:if ($object1===$object2)

does a recursive check!
"Fatal error: Nesting level too deep - recursive dependency?"
Whats going on?

I've go lots of object references all highly recursive and I just
sometimes need to check if two objects are the same object i.e. they
have the same storage address; I don't need to (and can't afford the
time) to recursively check every field.

Is there a ==== instead that REALLY does what it seems === is trying to
fake, presumably to cover up all the object copying that is normally
going on but that I've managed to avoid?

Sam

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

Offline

#5 Nov. 1, 2005 15:51:30

Wez F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] === on objects fails with recursion! WTH?


You'll need to search the mailing list archives.

--Wez.

On 11/1/05, Amin Azez <> wrote:
> Wez Furlong wrote:
> > I proposed a patch to fix this a while back (at least a year ago).
>
> I'm trying to file it as a bug, but bugs.php.net seems to be down,
> probably busy recusrively comparing objects or something.
>
> Could you post it (or a URL) please so I can patch.
> Had you already filed this as a bug report?
>
> Sadly searches on === reveal nothing.
>
>
> Sam
>
> >
> > --Wez.
> >
> > On 11/1/05, Amin Azez <> wrote:
> >
> >>if ($object1===$object2)
> >>
> >>does a recursive check!
> >>"Fatal error: Nesting level too deep - recursive dependency?"
> >>Whats going on?
> >>
> >>I've go lots of object references all highly recursive and I just
> >>sometimes need to check if two objects are the same object i.e. they
> >>have the same storage address; I don't need to (and can't afford the
> >>time) to recursively check every field.
> >>
> >>Is there a ==== instead that REALLY does what it seems === is trying to
> >>fake, presumably to cover up all the object copying that is normally
> >>going on but that I've managed to avoid?
> >>
> >>Sam
> >>
> >>--
> >>PHP Internals - PHP Runtime Development Mailing List
> >>To unsubscribe, visit:http://www.php.net/unsub.php> >>
> >>
> >
> >
>
>

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] === on objects fails with recursion! WTH? [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support