From e50449bcb4c72f13577aecc195baf691a8341a29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 4 Sep 2020 14:20:15 +0200 Subject: [PATCH] Use the canonical order of types in array|string ZPP error messages --- Zend/zend_API.h | 4 ++-- ext/pcre/tests/preg_replace_error1.phpt | 2 +- ext/pcre/tests/preg_replace_error2.phpt | 2 +- ext/phar/tests/phar_extract.phpt | 2 +- ext/soap/tests/fault_warning.phpt | 2 +- ext/standard/tests/array/bug74345.phpt | 2 +- ext/standard/tests/streams/bug61115.phpt | 2 +- ext/standard/tests/strings/join_variation1.phpt | 2 +- ext/standard/tests/strings/strtr_variation6.phpt | 2 +- ext/standard/tests/strings/strtr_variation8.phpt | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 264b677645..336060e576 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1223,8 +1223,8 @@ static zend_always_inline zval *zend_try_array_init(zval *zv) _(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \ _(Z_EXPECTED_NUMBER, "of type int|float") \ _(Z_EXPECTED_NUMBER_OR_NULL, "of type int|float|null") \ - _(Z_EXPECTED_STRING_OR_ARRAY, "of type string|array") \ - _(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type string|array|null") \ + _(Z_EXPECTED_STRING_OR_ARRAY, "of type array|string") \ + _(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type array|string|null") \ _(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \ _(Z_EXPECTED_STRING_OR_LONG_OR_NULL, "of type string|int|null") \ _(Z_EXPECTED_CLASS_NAME_OR_OBJECT, "a valid class name or object") \ diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt index 58cd049691..e654240f37 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" -preg_replace(): Argument #1 ($regex) must be of type string|array, stdClass given +preg_replace(): Argument #1 ($regex) must be of type array|string, stdClass given diff --git a/ext/pcre/tests/preg_replace_error2.phpt b/ext/pcre/tests/preg_replace_error2.phpt index 9a3056ab88..c4503aafd1 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 -preg_replace(): Argument #2 ($replace) must be of type string|array, stdClass given +preg_replace(): Argument #2 ($replace) must be of type array|string, stdClass given Done diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index 0ccd9d50d5..65a96b0aab 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -141,7 +141,7 @@ string(2) "hi" string(3) "hi3" string(3) "hi2" bool(false) -Phar::extractTo(): Argument #2 ($files) must be of type string|array|null, stdClass given +Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given Phar::extractTo(): Argument #1 ($pathto) must be a valid path, array given Invalid argument, extraction path must be non-zero length Unable to use path "%soops" for extraction, it is a file, must be a directory diff --git a/ext/soap/tests/fault_warning.phpt b/ext/soap/tests/fault_warning.phpt index 77b5154b9a..3a9fec6710 100644 --- a/ext/soap/tests/fault_warning.phpt +++ b/ext/soap/tests/fault_warning.phpt @@ -40,7 +40,7 @@ echo get_class($fault); ?> --EXPECT-- SoapFault::__construct(): Argument #1 ($faultcode) is not a valid fault code -SoapFault::__construct(): Argument #1 ($faultcode) must be of type string|array|null, stdClass given +SoapFault::__construct(): Argument #1 ($faultcode) must be of type array|string|null, stdClass given SoapFault SoapFault SoapFault::__construct(): Argument #1 ($faultcode) is not a valid fault code diff --git a/ext/standard/tests/array/bug74345.phpt b/ext/standard/tests/array/bug74345.phpt index 0916e17a54..cc55206760 100644 --- a/ext/standard/tests/array/bug74345.phpt +++ b/ext/standard/tests/array/bug74345.phpt @@ -42,5 +42,5 @@ try { --EXPECT-- array_map(): Argument #2 ($array1) must be of type array, null given array_map(): Argument #2 ($array1) must be of type array, null given -preg_replace_callback(): Argument #3 ($subject) must be of type string|array, stdClass given +preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given ===DONE=== diff --git a/ext/standard/tests/streams/bug61115.phpt b/ext/standard/tests/streams/bug61115.phpt index 28a1838c16..cb11e23d38 100644 --- a/ext/standard/tests/streams/bug61115.phpt +++ b/ext/standard/tests/streams/bug61115.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -preg_replace(): Argument #2 ($replace) must be of type string|array, Closure given +preg_replace(): Argument #2 ($replace) must be of type array|string, Closure given diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index 2e394c08a8..a21251aec2 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -147,7 +147,7 @@ string(16) "element1element2" -- Iteration 23 -- string(16) "element1element2" -- Iteration 24 -- -join(): Argument #1 ($glue) must be of type string|array, resource given +join(): Argument #1 ($glue) must be of type array|string, resource given -- Iteration 25 -- string(16) "element1element2" -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index 46902e5929..fcc903d637 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -119,7 +119,7 @@ string(6) "012atm" -- Iteration 16 -- string(6) "012ttm" -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type string|array, resource given +strtr(): Argument #2 ($from) must be of type array|string, resource given -- Iteration 18 -- string(6) "012atm" -- Iteration 19 -- diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt index 65aba9c51b..7ac60532f8 100644 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ b/ext/standard/tests/strings/strtr_variation8.phpt @@ -136,7 +136,7 @@ strtr(): Argument #2 ($from) must be of type array, string given strtr(): Argument #2 ($from) must be of type array, string given -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type string|array, resource given +strtr(): Argument #2 ($from) must be of type array|string, resource given -- Iteration 18 -- strtr(): Argument #2 ($from) must be of type array, string given -- 2.40.0