diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-11-20 15:44:27 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-11-20 15:44:27 +0800 |
commit | ebfd93f725eb9b9cfadbbde98047efe76f658da6 (patch) | |
tree | ebe3dc1c85fc4bebcd4f9080f44c75078266168a /ext/pcre/tests/bug73483.phpt | |
parent | 274951a4a2a2c5023d9bfd2e8032d64131e38225 (diff) | |
download | php-git-ebfd93f725eb9b9cfadbbde98047efe76f658da6.tar.gz |
Fixed bug #73483 (Segmentation fault on pcre_replace_callback)
Diffstat (limited to 'ext/pcre/tests/bug73483.phpt')
-rw-r--r-- | ext/pcre/tests/bug73483.phpt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug73483.phpt b/ext/pcre/tests/bug73483.phpt new file mode 100644 index 0000000000..fd10702527 --- /dev/null +++ b/ext/pcre/tests/bug73483.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #73483 (Segmentation fault on pcre_replace_callback) +--FILE-- +<?php +$regex = "#dummy#"; +setlocale(LC_ALL, "C"); +var_dump(preg_replace_callback($regex, function (array $matches) use($regex) { + setlocale(LC_ALL, "en_US"); + $ret = preg_replace($regex, "okey", $matches[0]); + setlocale(LC_ALL, "C"); + return $ret; +}, "dummy")); +?> +--EXPECT-- +string(4) "okey" |