xref: /PHP-8.0/ext/mbstring/tests/bug69151.phpt (revision 04441585)
1--TEST--
2Bug #69151 (mb_ereg should reject ill-formed byte sequence)
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip mbstring not available');
6if (!function_exists('mb_ereg')) die('skip mbregex support not available');
7?>
8--FILE--
9<?php
10$str = "\x80";
11
12var_dump(false === mb_eregi('.', $str, $matches));
13var_dump([] === $matches);
14
15var_dump(NULL === mb_ereg_replace('.', "\\0", $str));
16
17var_dump(false === mb_ereg_search_init("\x80", '.'));
18var_dump(false === mb_ereg_search());
19?>
20--EXPECT--
21bool(true)
22bool(true)
23bool(true)
24bool(true)
25bool(true)
26