bug73483.phpt 380 B

123456789101112131415
  1. --TEST--
  2. Bug #73483 (Segmentation fault on pcre_replace_callback)
  3. --FILE--
  4. <?php
  5. $regex = "#dummy#";
  6. setlocale(LC_ALL, "C");
  7. var_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--
  15. string(4) "okey"