Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- COM's approach to == vs. ===
- Csaba Gabor
June 14, 2006, 1:20 pm
rate this thread
prints "same" while the others all show "different"? Furthermore, if
you navigate an IE instance somewhere, differing DOM elements will
compare to true under ==.
$sh1 = new COM("WScript.Shell");
$sh2 = new COM("WScript.Shell");
$ie1 = new COM("InternetExplorer.Application");
$ie2 = new COM("InternetExplorer.Application");
print ($sh1==$sh2) ? "same " : "different ";
print ($sh1===$sh2) ? "same " : "different ";
print ($ie1==$ie2) ? "same " : "different ";
print ($ie1===$ie2) ? "same " : "different ";
Csaba Gabor from Vienna
under PHP 5 on Win XP Pro
Re: COM's approach to == vs. ===
Csaba Gabor wrote:
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
- » Heeeeeeeeeeeeeeeeeeeeeelp ! why this programme doesn't work?
- — Previous thread in » PHP Scripting Forum