#34297 [Fbk->Opn]: get_object_vars on COM object produces Apache error
| From: | csaba at alum dot mit dot edu | Date: | Wed, 31 Aug 2005 09:45:41 +0000 |
| Subject: | #34297 [Fbk->Opn]: get_object_vars on COM object produces Apache error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84230@lists.php.net to get a copy of this message | ||
ID: 34297
User updated by: csaba at alum dot mit dot edu
Reported By: csaba at alum dot mit dot edu
-Status: Feedback
+Status: Open
Bug Type: COM related
Operating System: Win XP Pro
PHP Version: 5.1.0RC1
New Comment:
I just went to http://snaps.php.net and got the latest binaries:
php5.1-win32-200508310630.zip
The problem still exists for me as originally reported.
Csaba
Previous Comments:
------------------------------------------------------------------------
[2005-08-29 16:47:53] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-08-29 16:22:01] csaba at alum dot mit dot edu
Description:
------------
If I do get_object_vars on a COM object, the code hangs and eventually
I get an Apache HTTP Server error message dialog telling me it's
encountered an error and needs to close and would I like to submit a
report.
If the code should indeed generate an error, shouldn't I be able to
trap for it rather than experience a hang?
Csaba Gabor from Vienna
Reproduce code:
---------------
<?php
class myClass { public static $static=1;
public $public=2;
private $private=3;
protected $protected=4; }
$oWS = new myClass();
$oWS = new COM("WScript.Shell");
print "<pre>\n";
print "gettype of \$oWS: " . gettype($oWS) . "\n";
print " class of \$oWS: " . get_class($oWS) . "\n";
try { print ('(array)$oWS: ');
$Arr = (array)$oWS;
print_r ( $Arr ); }
catch (Exception $e) {
print "(array) casting error.\n"; }
try { print ('get_objectvars($oWS): ');
$Arr = get_object_vars($oWS);
print_r ( $Arr ); }
catch (Exception $e) {
print "get_object_vars error."; }
print "\n</pre>";
?>
Expected result:
----------------
I expect to get one of:
(1) an array of filled in, accessible properties/values.
(2) an empty array as in the first try block
(3) an error message from the catch block
If you comment out the 5th line, as shown below, then you can see how
it looks when the object is an instance of a class:
// $oWS = new COM("WScript.Shell");
Actual result:
--------------
The first try/catch block works fine, producing an empty array. It's
the second one that hangs, producing the Apache error dialog (If I use
php.exe I get the same error dialog except with CLI in the title bar).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34297&edit=1