diff options
Diffstat (limited to 'ext/pcre/tests/invalid_utf8.phpt')
-rw-r--r-- | ext/pcre/tests/invalid_utf8.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/pcre/tests/invalid_utf8.phpt b/ext/pcre/tests/invalid_utf8.phpt new file mode 100644 index 0000000..56bad83 --- /dev/null +++ b/ext/pcre/tests/invalid_utf8.phpt @@ -0,0 +1,22 @@ +--TEST-- +preg_replace() and invalid UTF8 +--SKIPIF-- +<?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +?> +--FILE-- +<?php + +$string = urldecode("search%e4"); +$result = preg_replace("#(&\#x*)([0-9A-F]+);*#iu","$1$2;",$string); +var_dump($result); +var_dump(preg_last_error()); + +echo "Done\n"; +?> +--EXPECT-- +NULL +int(4) +Done |