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