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] [EMAIL PROTECTED]

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

Reply via email to