Skip to content

Commit f440911

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fixed ValueError message in count_chars() Fixed ValueError message in substr_compare() The userland constants do not start with PHP_
2 parents bf2e778 + adc5edd commit f440911

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

ext/standard/string.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5305,7 +5305,7 @@ PHP_FUNCTION(count_chars)
53055305
ZEND_PARSE_PARAMETERS_END();
53065306

53075307
if (mymode < 0 || mymode > 4) {
5308-
zend_argument_value_error(2, "must be between 1 and 4 (inclusive)");
5308+
zend_argument_value_error(2, "must be between 0 and 4 (inclusive)");
53095309
RETURN_THROWS();
53105310
}
53115311

@@ -5958,7 +5958,7 @@ PHP_FUNCTION(substr_compare)
59585958
}
59595959

59605960
if ((size_t)offset > ZSTR_LEN(s1)) {
5961-
zend_argument_value_error(3, "must be contained in argument #1 ($main_str)");
5961+
zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
59625962
RETURN_THROWS();
59635963
}
59645964

ext/standard/tests/strings/bug40754.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ string(6) "abcdex"
8181
int(0)
8282
int(0)
8383
substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
84-
substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($main_str)
84+
substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
8585
stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
8686
substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
8787
substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack)

ext/standard/tests/strings/count_chars_basic.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1569,4 +1569,4 @@ array(238) {
15691569
}
15701570
string(18) " Rabcdefghimnorstu"
15711571
string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
1572-
count_chars(): Argument #2 ($mode) must be between 1 and 4 (inclusive)
1572+
count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive)

ext/xml/tests/xml_parser_get_option_variation4.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ try {
1515

1616
?>
1717
--EXPECT--
18-
xml_parser_get_option(): Argument #2 ($option) must be a PHP_XML_OPTION_* constant
18+
xml_parser_get_option(): Argument #2 ($option) must be a XML_OPTION_* constant

ext/xml/tests/xml_parser_set_option_variation5.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ try {
1515

1616
?>
1717
--EXPECT--
18-
xml_parser_set_option(): Argument #2 ($option) must be a PHP_XML_OPTION_* constant
18+
xml_parser_set_option(): Argument #2 ($option) must be a XML_OPTION_* constant

ext/xml/xml.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ PHP_FUNCTION(xml_parser_set_option)
14381438
break;
14391439
}
14401440
default:
1441-
zend_argument_value_error(2, "must be a PHP_XML_OPTION_* constant");
1441+
zend_argument_value_error(2, "must be a XML_OPTION_* constant");
14421442
RETURN_THROWS();
14431443
break;
14441444
}
@@ -1473,7 +1473,7 @@ PHP_FUNCTION(xml_parser_get_option)
14731473
RETURN_STRING((char *)parser->target_encoding);
14741474
break;
14751475
default:
1476-
zend_argument_value_error(2, "must be a PHP_XML_OPTION_* constant");
1476+
zend_argument_value_error(2, "must be a XML_OPTION_* constant");
14771477
RETURN_THROWS();
14781478
}
14791479
}

0 commit comments

Comments
 (0)