|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-02-07 11:47 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
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