xref: /PHP-8.3/ext/pcre/tests/bug73483.phpt (revision f8d79582)
1--TEST--
2Bug #73483 (Segmentation fault on pcre_replace_callback)
3--FILE--
4<?php
5$regex = "#dummy#";
6setlocale(LC_ALL, "C");
7var_dump(preg_replace_callback($regex, function (array $matches) use($regex) {
8    setlocale(LC_ALL, "en_US");
9    $ret = preg_replace($regex, "okey", $matches[0]);
10    setlocale(LC_ALL, "C");
11    return $ret;
12}, "dummy"));
13?>
14--EXPECT--
15string(4) "okey"
16