xref: /PHP-8.3/ext/mbstring/tests/bug77428.phpt (revision 74859783)
1--TEST--
2Bug #77428: mb_ereg_replace() doesn't replace a substitution variable
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (!function_exists('mb_ereg_replace')) die('skip mb_ereg_replace() not available');
8?>
9--FILE--
10<?php
11
12// This behavior is broken, but kept for BC reasons
13var_dump(mb_ereg_replace('(%)', '\\\1', 'a%c'));
14// For clarity, the above line is equivalent to:
15var_dump(mb_ereg_replace('(%)', '\\\\1', 'a%c'));
16
17?>
18--EXPECT--
19string(4) "a\%c"
20string(4) "a\%c"
21