xref: /PHP-5.6/ext/mbstring/tests/bug43301.phpt (revision 0ac9b9b0)
1--TEST--
2Bug #43301 (mb_ereg*_replace() crashes when replacement string is invalid PHP expression and 'e' option is used)
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--FILE--
6<?php
7
8$ptr = 'hello';
9
10$txt = <<<doc
11hello, I have got a cr*sh on you
12doc;
13
14echo mb_ereg_replace($ptr,'$1',$txt,'e');
15
16?>
17--EXPECTF--
18Parse error: syntax error, unexpected %s, expecting %s or '$' in %sbug43301.php(%d) : mbregex replace on line %d
19
20Fatal error: mb_ereg_replace(): Failed evaluating code:
21$1 in %sbug43301.php on line %d
22