Reference # in var_dump output?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi.  Quick question:  I'm comparing two stdClass objects and getting
an unexpected inequality--nonidenticality?  Is there a word for the
state of !== returning true?  As far as I can tell, all the members
are identical. There is one difference between the two in a var_dump
output, but I'm not sure if that should make PHP consider the two to
be nonidentical:

object(stdClass)#15013 (17) {
  ...[all the same here]...

object(stdClass)#15252 (17) {
  ...[all the same here]...

Literally, the only difference is what follows the # sign.  I am
assuming that's some kind of reference id or something, but perhaps
I'm mistaken.  Could that be what's making this errantly pass a !==

Re: Reference # in var_dump output?

Quoted text here. Click to load it

Whoops.  Disregard.  Didn't realize they had to be references to the
same instance to pass =3D=3D.  Guess I'll have to use =3D for the che=


Two instances of the same class
o1 =3D o2 : TRUE
o1 !=3D o2 : FALSE
o1 =3D=3D o2 : FALSE
o1 !=3D=3D o2 : TRUE

Site Timeline