|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-29 16:47 UTC] sniper@php.net
[2005-08-31 11:45 UTC] csaba at alum dot mit dot edu
[2005-08-31 13:33 UTC] sniper@php.net
[2006-12-24 12:39 UTC] rrichards@php.net
[2007-01-01 01:00 UTC] php-bugs at lists dot php dot net
[2007-01-25 13:39 UTC] csaba at alum dot mit dot edu
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 01:00:02 2025 UTC |
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).