|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34297 get_object_vars on COM object produces Apache error
Submitted: 2005-08-29 16:22 UTC Modified: 2007-01-25 13:39 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: csaba at alum dot mit dot edu Assigned: wez (profile)
Status: Closed Package: COM related
PHP Version: 5CVS-2005-08-31 OS: win32
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
25 + 22 = ?
Subscribe to this entry?

 [2005-08-29 16:22 UTC] csaba at alum dot mit dot edu
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:
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).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-29 16:47 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-08-31 11:45 UTC] csaba at alum dot mit dot edu
I just went to and got the latest binaries:

The problem still exists for me as originally reported.

 [2005-08-31 13:33 UTC]
Assigned to the maintainer.
 [2006-12-24 12:39 UTC]
Please try using this CVS snapshot:
For Windows:

 [2007-01-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-01-25 13:39 UTC] csaba at alum dot mit dot edu
Hurrah, I just checked and I'm not getting any errors.  This is with the latest version of PHP 5.2 and Apache 2.2.  Thanks.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Mar 30 11:03:45 2023 UTC