xref: /PHP-8.1/ext/mbstring/tests/bug81298.phpt (revision a2bc57e0)
1--TEST--
2Bug #81298: mb_detect_encoding() segfaults when 7bit encoding is specified
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7
8var_dump(mb_detect_encoding("foobar.", "7bit"));
9var_dump(mb_detect_encoding("foobar.", "7bit,ascii"));
10var_dump(mb_detect_encoding("foobar.", "7bit,ascii,utf8"));
11var_dump(mb_detect_encoding("foobar.", "html"));
12var_dump(mb_detect_encoding("foobar.", "ascii,html"));
13
14?>
15--EXPECT--
16bool(false)
17string(5) "ASCII"
18string(5) "ASCII"
19bool(false)
20string(5) "ASCII"
21