xref: /PHP-8.1/ext/mbstring/tests/bug72399.phpt (revision 4083600b)
1--TEST--
2Bug #72399 (Use-After-Free in MBString (search_re))
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (!function_exists('mb_ereg')) die('skip mbregex support not available');
8?>
9--FILE--
10<?php
11$var5 = mb_ereg_search_init("","2");
12var_dump($var5);
13$var6 = mb_eregi_replace("2","","");
14var_dump($var6);
15
16try {
17    $var13 = mb_ereg_search_pos();
18} catch (\Error $e) {
19    echo $e->getMessage() . \PHP_EOL;
20}
21?>
22--EXPECT--
23bool(true)
24string(0) ""
25No pattern was provided
26