|
Posted by Chung Leong on 06/14/06 19:29
Csaba Gabor wrote:
> Wayne wrote:
> > On 14 Jun 2006 06:20:47 -0700, "Csaba Gabor" <danswer@gmail.com>
> > wrote:
> >
> > >Why is it that in the following code, the third line with ($ie1==$ie2)
> > >prints "same" while the others all show "different"?
> >
> > Well == means do these objects have all the same properties where as
> > === means are these the same object instances.
>
> This is not true in the case of IE or objects on it. For example,
> $ie1->hwnd!=$ie2->hwnd. Something else is at work here.
>
> > You pretty much always want to use === with objects.
>
> I don't have a problem working around it (and using === as
> appropriate), but it would be nice to understand what's going on.
My guess is that the IE automation object exposes a default property.
When that's the case, I believe PHP would retrieve the values of the
default property and compare them instead of comparing the object.
Try doing echoing $ie1 and $ie2 and see if you get different text
strings.
Navigation:
[Reply to this message]
|