3v4l.org

run code in 200+ PHP versions simultaneously
<?php var_dump(mb_ereg_replace('(%)', '\\\1', 'a%c'));
based on tpGEP
Output for 7.1.25 - 7.2.24, 7.3.2 - 7.4.0
string(4) "a\%c"
Output for 7.3.0 - 7.3.1
string(5) "a\\1c"