xref: /PHP-7.2/ext/mbstring/tests/bug49536.phpt (revision 59b9ca51)
1--TEST--
2Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is turned on)
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--FILE--
6<?php
7// non-strict mode
8var_dump(mb_detect_encoding("A\x81", "SJIS", false));
9// strict mode
10var_dump(mb_detect_encoding("A\x81", "SJIS", true));
11// non-strict mode
12var_dump(mb_detect_encoding("\xc0\x00", "UTF-8", false));
13// strict mode
14var_dump(mb_detect_encoding("\xc0\x00", "UTF-8", true));
15?>
16--EXPECT--
17string(4) "SJIS"
18bool(false)
19bool(false)
20bool(false)
21