From: csaba at alum dot mit dot edu
Operating system: Win XP Pro
PHP version: 5.2.5
PHP Bug Type: COM related
Bug description: $ie not cleared on IE quit
Description:
------------
In the code below, if the visible IE is closed, whether by script or by
the user, the bug manifests itself. What will happen is that there will be
a sequence of (ReadyState) 4's displayed while IE is extant. When IE is
closed, "Exiting" should be printed, but what happens is that a sequence of
ReadyState=0's is printed, which is a bug.
The bug only happens if there are no instances of IE when the script is
run.
The second instance of $ie has to be 'static'
Csaba Gabor from Vienna
Reproduce code:
---------------
<?php
// IE being closed doesn't terminate script
// if there are no IE instances on startup
$ie = new COM("InternetExplorer.Application");
$ie->visible = true;
$ie->Navigate2 ("about:blank");
$ie2 = new COM("InternetExplorer.Application");
try { while ($ie->ReadyState>=0) {
print $ie->ReadyState;
com_message_pump(200); } }
catch (com_exception $e) {}
print "Exiting";
?>
Expected result:
----------------
I expect to see a sequence of 4s until I close IE, and then I expect to
see Exiting printed
Actual result:
--------------
A sequence of 4s is printed, but when I close IE a sequence of 0s is
printed which doesn't terminate till I use the windows task manager
(ctrl+alt+delete) to kill the iexplore process. (One could also use ctrl+C
in the Cmd window, but that leaves a hidden IE instance, so the bug won't
show itself next time around, until the IE is removed).
The bug manifests itself without user actions if
$ie->Quit();
is inserted right above the 'try' line
If there is already an instance of IE in existence, then the bug does not
happen.
The bug will also show itself if the '$ie2' line is replaced with:
ieStatic();
function ieStatic() {
static $ie;
$ie = new COM("InternetExplorer.Application"); }
--
Edit bug report at http://bugs.php.net/?id=43897&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43897&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43897&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43897&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43897&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43897&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43897&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43897&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43897&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43897&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43897&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43897&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43897&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43897&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43897&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43897&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43897&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43897&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43897&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43897&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43897&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43897&r=mysqlcfg