|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-24 12:17 UTC] jani@php.net
[2014-12-30 05:51 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: wharmby
+Assigned To:
[2020-02-06 16:31 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-02-06 16:31 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ I can't iterate over IE's $ie->document->createEventObject() with PHP whereas I can in IE. Reproduce code: --------------- <?php // create a new internet explorer instance $ie = new COM("InternetExplorer.Application"); // So the alerts can be seen $ie->visible = true; // ensure a document exists within ie $ie->Navigate2 ("about:blank"); while ($ie->readyState!=4) usleep(100000); // convenience $doc = $ie->document; $window = $doc->parentWindow; // required - var must be declared $window->execScript ("var evt='';"); // create an event object $window->evt = $doc->createEventObject(); // proof the object is valid, iteratable $window->execScript(" var str=''; var idx; for (idx in evt) str+=idx+'; '; alert('Keys: '+str);"); // Bug: can't iterate the object in PHP foreach ($window->evt as $prop => $val) print "<br>$prop "; // ensure ie is still alive $window->execScript("alert('Alive');"); $ie->quit(); // necessary since visible ?> Expected result: ---------------- I expect PHP not to die at the foreach I expect the same text to be output as with the alert Actual result: -------------- PHP falls over upon hitting the foreach loop with: Fatal error: Uncaught exception 'Exception' with message 'Object of type variant did not create an Iterator' in c:\phpBugs\foreach.php: 28 Stack trace: #0 C:\phpBugs\foreach.php(28): unknown() #1 {main} thrown in C:\phpBugs\foreach.php on line 28