summaryrefslogtreecommitdiff
path: root/ext/pcre/tests
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-06-22 16:29:59 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-07-09 14:17:19 +0200
commitaf1de148025197f4f9131c2f074ea9ce65b7b04d (patch)
tree267432b0a83dcce4f134b86cb8fb47252d125b48 /ext/pcre/tests
parent9839752a9c364dcec6e3c6f15f25987498486171 (diff)
downloadphp-git-af1de148025197f4f9131c2f074ea9ce65b7b04d.tar.gz
Use ZPP string|array union check in PCRE extension
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r--ext/pcre/tests/preg_replace_callback_array2.phpt13
-rw-r--r--ext/pcre/tests/preg_replace_error1.phpt2
-rw-r--r--ext/pcre/tests/preg_replace_error2.phpt2
3 files changed, 11 insertions, 6 deletions
diff --git a/ext/pcre/tests/preg_replace_callback_array2.phpt b/ext/pcre/tests/preg_replace_callback_array2.phpt
index f333d06dcb..679a4b0c54 100644
--- a/ext/pcre/tests/preg_replace_callback_array2.phpt
+++ b/ext/pcre/tests/preg_replace_callback_array2.phpt
@@ -5,7 +5,14 @@ preg_replace_callback_array() errors
$a = array();
$b = "";
-var_dump(preg_replace_callback_array(array("xx" => "s"), $a, -1, $b));
+
+try {
+ var_dump(preg_replace_callback_array(array("xx" => "s"), $a, -1, $b));
+} catch (\TypeError $e) {
+ echo $e->getMessage() . \PHP_EOL;
+}
+
+
var_dump($b);
function f() {
static $count = 1;
@@ -23,9 +30,7 @@ try {
echo "Done\n";
?>
--EXPECTF--
-Warning: preg_replace_callback_array(): 's' is not a valid callback in %spreg_replace_callback_array2.php on line %d
-array(0) {
-}
+'s' is not a valid callback
string(0) ""
Warning: preg_replace_callback_array(): No ending delimiter '/' found in %spreg_replace_callback_array2.php on line %d
diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt
index 39d0b692e7..58cd049691 100644
--- a/ext/pcre/tests/preg_replace_error1.phpt
+++ b/ext/pcre/tests/preg_replace_error1.phpt
@@ -56,4 +56,4 @@ string(1) "a"
Arg value is /[a-zA-Z]/
string(1) "1"
-Object of class stdClass could not be converted to string
+preg_replace(): Argument #1 ($regex) must be of type string|array, stdClass given
diff --git a/ext/pcre/tests/preg_replace_error2.phpt b/ext/pcre/tests/preg_replace_error2.phpt
index 0aefff9df6..9a3056ab88 100644
--- a/ext/pcre/tests/preg_replace_error2.phpt
+++ b/ext/pcre/tests/preg_replace_error2.phpt
@@ -36,5 +36,5 @@ string(64) "this is a stringthis is a stringthis is a stringthis is a string"
Arg value is: Array
preg_replace(): Argument #1 ($regex) must be of type array when argument #2 ($replace) is an array, string given
-Object of class stdClass could not be converted to string
+preg_replace(): Argument #2 ($replace) must be of type string|array, stdClass given
Done