From:             csaba at alum dot mit dot edu
Operating system: Win XP Pro
PHP version:      5.1.0RC1
PHP Bug Type:     COM related
Bug description:  get_object_vars on COM object produces Apache error

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 bug report at http://bugs.php.net/?id=34297&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34297&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34297&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34297&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34297&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34297&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34297&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34297&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34297&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34297&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34297&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34297&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34297&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34297&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34297&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34297&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34297&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34297&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34297&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34297&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34297&r=mysqlcfg

Reply via email to