xref: /PHP-8.3/ext/iconv/tests/bug69840.phpt (revision e9f783fc)
1--TEST--
2Bug #69840 (iconv_substr() doesn't work with UTF-16BE)
3--EXTENSIONS--
4iconv
5--FILE--
6<?php
7$str = iconv_substr("a\x00b\x00", 0, 1, 'UTF-16LE');
8var_dump(strlen($str));
9var_dump(ord($str[0]));
10var_dump(ord($str[1]));
11$str = iconv_substr("\x00a\x00b", 0, 1, 'UTF-16BE');
12var_dump(strlen($str));
13var_dump(ord($str[0]));
14var_dump(ord($str[1]));
15?>
16--EXPECT--
17int(2)
18int(97)
19int(0)
20int(2)
21int(0)
22int(97)
23