summaryrefslogtreecommitdiff
path: root/ext/iconv/tests/bug69840.phpt
blob: 93bda9a731d22345c4846cf06b54cdd9dd67fa84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Bug #69840 (iconv_substr() doesn't work with UTF-16BE)
--SKIPIF--
<?php require 'skipif.inc'; ?>
--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)