note 52610 rejected from function.com-isenum by nlopess

From: Date: Sat, 07 May 2005 07:34:01 +0000
Subject: note 52610 rejected from function.com-isenum by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-89058@lists.php.net to get a copy of this message
Note Submitter: mpg123 at thinstall dot com ---- So they removed this from PHP5. Great, so how do we test if a COM object can iterate or not? Count() doesn't work, nor does is_array()... $domObj = new COM("WinNT://domain"); foreach ($domObj as $obj) { echo $obj->Name . "\r\n"; } This works, yields a list of names. $domObj = new COM("WinNT://domain/Administrator"); foreach ($domObj as $obj) { echo $obj->Name . "\r\n"; } Now it won't work. But we can't test, so we get a fatal error.

« previous php.notes (#89058) next »