You are here: Re: COM's approach to == vs. === « PHP Programming Language « IT news, forums, messages
Re: COM's approach to == vs. ===

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация