php.net |  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
Votes:2
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
 [2005-08-29 16:22 UTC] 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).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-29 16:47 UTC] 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-31 11:45 UTC] csaba at alum dot mit dot edu
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
 [2005-08-31 13:33 UTC] sniper@php.net
Assigned to the maintainer.
 [2006-12-24 12:39 UTC] rrichards@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [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: Sun Jan 29 00:03:44 2023 UTC