summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug79188.phpt
blob: 875aad7b982846a74b27d99fb3765b4879987cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
--TEST--
Bug #79188: Memory corruption in preg_replace/preg_replace_callback and unicode
--FILE--
<?php

var_dump(preg_replace("//u", "", "a" . str_repeat("\u{1f612}", 10)));
var_dump(preg_replace_callback(
    "//u", function() { return ""; }, "a" . str_repeat("\u{1f612}", 10)));

?>
--EXPECT--
string(41) "a😒😒😒😒😒😒😒😒😒😒"
string(41) "a😒😒😒😒😒😒😒😒😒😒"