xref: /PHP-7.4/ext/pcre/tests/bug79188.phpt (revision 13bfa9f5)
1--TEST--
2Bug #79188: Memory corruption in preg_replace/preg_replace_callback and unicode
3--FILE--
4<?php
5
6var_dump(preg_replace("//u", "", "a" . str_repeat("\u{1f612}", 10)));
7var_dump(preg_replace_callback(
8    "//u", function() { return ""; }, "a" . str_repeat("\u{1f612}", 10)));
9
10?>
11--EXPECT--
12string(41) "a��������������������"
13string(41) "a��������������������"
14