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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jamie dot layne at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 20 02:01:29 2024 UTC