php-src/ext/mbstring/tests/bug43301.phpt

22 lines
557 B
Plaintext
Raw Normal View History

--TEST--
2007-11-16 12:29:29 +00:00
Bug #43301 (mb_ereg*_replace() crashes when replacement string is invalid PHP expression and 'e' option is used)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
$ptr = 'hello';
$txt = <<<doc
hello, I have got a cr*sh on you
doc;
echo mb_ereg_replace($ptr,'$1',$txt,'e');
?>
--EXPECTF--
2011-11-08 06:35:07 +00:00
Parse error: syntax error, unexpected %s, expecting %s or '$' in %sbug43301.php(%d) : mbregex replace on line %d
Fatal error: mb_ereg_replace(): Failed evaluating code:
$1 in %sbug43301.php on line %d