xref: /PHP-8.0/ext/com_dotnet/tests/bug63208.phpt (revision a385cfa7)
1--TEST--
2Bug #63208 (BSTR to PHP string conversion not binary safe)
3--SKIPIF--
4<?php
5if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
6?>
7--FILE--
8<?php
9$string = "\u{0905}b\0cd";
10$variant = new VARIANT($string, VT_ARRAY | VT_UI1, CP_UTF8); // Array of bytes
11$converted = (string) $variant;
12var_dump(bin2hex($string));
13var_dump(bin2hex($converted));
14?>
15--EXPECT--
16string(14) "e0a48562006364"
17string(14) "e0a48562006364"
18