Skip to content

Commit 524391b

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

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

ext/standard/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5105,7 +5105,7 @@ PHP_FUNCTION(count_chars)
51055105
ZEND_PARSE_PARAMETERS_END();
51065106

51075107
if (mymode < 0 || mymode > 4) {
5108-
zend_argument_value_error(2, "must be between 1 and 4 (inclusive)");
5108+
zend_argument_value_error(2, "must be between 0 and 4 (inclusive)");
51095109
RETURN_THROWS();
51105110
}
51115111

@@ -5758,7 +5758,7 @@ PHP_FUNCTION(substr_compare)
57585758
}
57595759

57605760
if ((size_t)offset > ZSTR_LEN(s1)) {
5761-
zend_argument_value_error(3, "must be contained in argument #1 ($main_str)");
5761+
zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
57625762
RETURN_THROWS();
57635763
}
57645764

ext/standard/tests/strings/bug40754.phpt

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ PHP_FUNCTION(xml_parser_set_option)
14321432
break;
14331433
}
14341434
default:
1435-
zend_argument_value_error(2, "must be a PHP_XML_OPTION_* constant");
1435+
zend_argument_value_error(2, "must be a XML_OPTION_* constant");
14361436
RETURN_THROWS();
14371437
break;
14381438
}
@@ -1467,7 +1467,7 @@ PHP_FUNCTION(xml_parser_get_option)
14671467
RETURN_STRING((char *)parser->target_encoding);
14681468
break;
14691469
default:
1470-
zend_argument_value_error(2, "must be a PHP_XML_OPTION_* constant");
1470+
zend_argument_value_error(2, "must be a XML_OPTION_* constant");
14711471
RETURN_THROWS();
14721472
}
14731473
}

0 commit comments

Comments
 (0)