summaryrefslogtreecommitdiff
path: root/ext/iconv
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2015-06-17 13:40:19 +0200
committerChristoph M. Becker <cmb@php.net>2015-06-17 13:40:19 +0200
commitc9554b90e4bf96f8a3f617b95775e2a94aeb8237 (patch)
tree5bc496905ae125a3aa0dd00302426ab32fe91a91 /ext/iconv
parent4a6e1345e2dfd1d1edfd18b783bc9000598a4d92 (diff)
downloadphp-git-c9554b90e4bf96f8a3f617b95775e2a94aeb8237.tar.gz
added regression test for bug #69840
Diffstat (limited to 'ext/iconv')
-rw-r--r--ext/iconv/tests/bug69840.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/iconv/tests/bug69840.phpt b/ext/iconv/tests/bug69840.phpt
new file mode 100644
index 0000000000..af79bbcdd6
--- /dev/null
+++ b/ext/iconv/tests/bug69840.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #69840 (iconv_substr() doesn't work with UTF-16BE)
+--FILE--
+<?php
+$str = iconv_substr("a\x00b\x00", 0, 1, 'UTF-16LE');
+var_dump(strlen($str));
+var_dump(ord($str[0]));
+var_dump(ord($str[1]));
+$str = iconv_substr("\x00a\x00b", 0, 1, 'UTF-16BE');
+var_dump(strlen($str));
+var_dump(ord($str[0]));
+var_dump(ord($str[1]));
+?>
+--EXPECT--
+int(2)
+int(97)
+int(0)
+int(2)
+int(0)
+int(97)