summaryrefslogtreecommitdiff
path: root/ext/pcre/tests
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-25 18:06:07 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-08-25 18:09:50 +0200
commitea87d0480fbfcdd1610bb56e680f64840b233b0c (patch)
tree2d530376df32fd75e5ff953b22d78997dd5eb04a /ext/pcre/tests
parent2369f48092a15a42731a4c1d1d8a1c770517a780 (diff)
downloadphp-git-ea87d0480fbfcdd1610bb56e680f64840b233b0c.tar.gz
Promote warnings to exceptions in ext/pcre
Closes GH-6006
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r--ext/pcre/tests/002.phpt9
-rw-r--r--ext/pcre/tests/preg_replace_callback_array2.phpt2
2 files changed, 7 insertions, 4 deletions
diff --git a/ext/pcre/tests/002.phpt b/ext/pcre/tests/002.phpt
index 073a7a8d56..641cffb05e 100644
--- a/ext/pcre/tests/002.phpt
+++ b/ext/pcre/tests/002.phpt
@@ -3,7 +3,11 @@ preg_* with bogus vals
--FILE--
<?php
-var_dump(preg_match_all('//', '', $dummy, 0xdead));
+try {
+ preg_match_all('//', '', $dummy, 0xdead);
+} catch (ValueError $exception) {
+ echo $exception->getMessage() . "\n";
+}
var_dump(preg_quote(''));
@@ -13,8 +17,7 @@ var_dump(preg_replace('/(.)/e', 'for ($', 'abc'));
?>
--EXPECTF--
-Warning: preg_match_all(): Invalid flags specified in %s002.php on line %d
-NULL
+preg_match_all(): Argument #4 ($flags) must be a PREG_* constant
string(0) ""
string(12) "a${1b${1c${1"
diff --git a/ext/pcre/tests/preg_replace_callback_array2.phpt b/ext/pcre/tests/preg_replace_callback_array2.phpt
index 679a4b0c54..aca11dc19c 100644
--- a/ext/pcre/tests/preg_replace_callback_array2.phpt
+++ b/ext/pcre/tests/preg_replace_callback_array2.phpt
@@ -30,7 +30,7 @@ try {
echo "Done\n";
?>
--EXPECTF--
-'s' is not a valid callback
+preg_replace_callback_array(): Argument #1 ($pattern) must contain only valid callbacks
string(0) ""
Warning: preg_replace_callback_array(): No ending delimiter '/' found in %spreg_replace_callback_array2.php on line %d