]> granicus.if.org Git - php/commitdiff
Add test for bug #76850
authorAnatol Belski <ab@php.net>
Sat, 8 Sep 2018 19:39:54 +0000 (21:39 +0200)
committerAnatol Belski <ab@php.net>
Sat, 8 Sep 2018 19:39:54 +0000 (21:39 +0200)
ext/pcre/tests/bug76850.phpt [new file with mode: 0644]

diff --git a/ext/pcre/tests/bug76850.phpt b/ext/pcre/tests/bug76850.phpt
new file mode 100644 (file)
index 0000000..ec06ccf
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Bug #76850 Exit code mangled by set locale/preg_match
+--FILE--
+<?php
+
+function foo()
+{
+        $oldlocale = setlocale(LC_CTYPE, 0);
+        setlocale(LC_CTYPE, $oldlocale);
+}
+
+foo();
+
+var_dump(preg_match('/./', "a"));
+
+?>
+==DONE==
+--EXPECT--
+int(1)
+==DONE==
+