xref: /PHP-8.1/ext/mbstring/tests/bug49536.phpt (revision 39131219)
1--TEST--
2Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is turned on)
3--EXTENSIONS--
4mbstring
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