bug27103.phpt
来自「PHP v6.0 For Linux 运行环境:Win9X/ WinME/ Wi」· PHPT 代码 · 共 38 行
PHPT
38 行
--TEST--Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets)--FILE--<?phpfunction iter($ar){ foreach ($ar as $c) { echo htmlentities($c, 0, "UTF-8"), ": ", strlen($c), "\n"; }}$teststr = "\xe2\x82\xac hi there";iter(preg_split('//u', $teststr, -1, PREG_SPLIT_NO_EMPTY));preg_match_all('/./u', $teststr, $matches);iter($matches[0]);?>--EXPECT--€: 3 : 1h: 1i: 1 : 1t: 1h: 1e: 1r: 1e: 1€: 3 : 1h: 1i: 1 : 1t: 1h: 1e: 1r: 1e: 1
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?