xref: /php-src/ext/mbstring/tests/gh13815.phpt (revision f8137084)
1--TEST--
2GH-13815 (mb_trim() inaccurate $characters default value)
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7$strUtf8 = "\u{3042}\u{3000}"; // U+3000: fullwidth space
8var_dump(mb_strlen(mb_trim($strUtf8)));
9var_dump(mb_strlen(mb_trim($strUtf8, encoding: 'UTF-8')));
10
11mb_internal_encoding('Shift_JIS');
12$strSjis = mb_convert_encoding($strUtf8, 'Shift_JIS', 'UTF-8');
13var_dump(mb_strlen(mb_trim($strSjis)));
14var_dump(mb_strlen(mb_trim($strSjis, encoding: 'Shift_JIS')));
15?>
16--EXPECT--
17int(1)
18int(1)
19int(1)
20int(1)
21