xref: /PHP-7.4/ext/mbstring/tests/bug72994.phpt (revision 40fe50da)
1--TEST--
2Bug #72994 (mbc_to_code() out of bounds read)
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$var1 = mb_ereg_replace($var-232338951,NULL,NULL,NULL);
11var_dump($var1);
12?>
13===DONE===
14--EXPECTF--
15Notice: Undefined variable: var in %s on line %d
16
17Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
18
19Warning: mb_ereg_replace(): Pattern is not valid under UTF-8 encoding in %s on line %d
20bool(false)
21===DONE===
22