php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35689 Object of type com did not create an Iterator
Submitted: 2005-12-15 20:30 UTC Modified: 2005-12-16 00:05 UTC
From: jamie dot layne at gmail dot com Assigned: Wez (profile)
Status: Not a bug Package: COM related
PHP Version: 5.1.1 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2005-12-15 20:30 UTC] jamie dot layne at gmail dot com
Description:
------------
The recommended way of iterating over COM as per Zend.com is to use the foreach($com as $ob) method, as opposed to the old $com->Next() approach.

This hasn't been working for objects of type COM or VARIANT.

Specs:
Windows Server 2003
PHP 5.1.1


Reproduce code:
---------------
<?
-- Example --
$word = new COM("word.application"); 
foreach ($word as $obj) { 
echo $obj. "<br>"; 
} 
?>

Expected result:
----------------
List of properties for the desired COM object

Actual result:
--------------
Object of type com did not create an Iterator

Similar error:
Object of type variant did not create an Iterator


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 00:05 UTC] wez@php.net
COM objects don't have that behaviour.
foreach() will ask the COM object for its default property and request an iteratable interface from it.
If it can't get one, you get that error.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC