PHP 8.1.9 (tried also 7.4.3) VARIANT property assignment causes error (no error in equivalent VBScript)
Open
@cmb69 is already working on this.
Since Aug 9, 2022.
Bug
Extension: com_dotnet
Status: Verified
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Note: MSMQ is a standard COM library present in all Windows versions.
The following code:
<?php
$msg = new COM("MSMQ.MSMQMessage", null, CP_UTF8);
$msg->Body = 123;
Resulted in this output:
PHP Fatal error: Uncaught com_exception: Source: MSMQMessage
Description: The parameter is incorrect. in C:\Temp\test.php:3
Stack trace:
#0 {main}
thrown in C:\Temp\test.php on line 3
But I expected NO OUTPUT AT ALL.
Equivalent VBScript code, which does not cause any errors:
Set msg = CreateObject("MSMQ.MSMQMessage")
msg.Body = 123
Both files attached: test.zip
PHP Version
php-8.1.9-nts-Win32-vs16-x64
Operating System
Windows 10 x64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.