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