From: setvik at gmail dot com
Operating system: Windows Server 2003
PHP version: 5.2.9RC2
PHP Bug Type: COM related
Bug description: Can't instantiate VARIANT objects with VT_BYREF flag
Description:
------------
PHP crashes when instantiating a VARIANT object with the BYREF flag.
This makes it impossible to pass arguments to COM functions that require
them to be passed by reference (MS Word's PrintOut function, for example).
(Tested in PHP 5.2.8 and 5.2.9rc2).
Reproduce code:
---------------
$var = new VARIANT(TRUE, VT_BOOL|VT_BYREF);
Expected result:
----------------
Execution should continue, and I should be able to pass $var to a windows
com function:
EXAMPLE:
$word = new COM("Word.Application");
$word->Documents->Open("mydoc.doc");
$var = new VARIANT(TRUE, VT_BOOL|VT_BYREF);
$word->ActiveDocument->PrintOut($var);
Actual result:
--------------
PHP Fatal error: Uncaught exception 'com_exception' with message 'Variant
type conversion failed: Type mismatch.
' in D:\test.php:1
Stack trace:
#0 D:\test.php(1): variant->variant(true, 16395)
#1 {main}
thrown in D:\test.php on line 1
--
Edit bug report at http://bugs.php.net/?id=47401&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47401&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47401&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47401&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47401&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47401&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47401&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47401&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47401&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47401&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47401&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47401&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47401&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47401&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47401&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47401&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47401&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47401&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47401&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47401&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47401&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47401&r=mysqlcfg