Skip to content

Commit 86fecd9

Browse files
committed
Improve ArgumentCountError error message
1 parent 91314f3 commit 86fecd9

File tree

78 files changed

+156
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+156
-156
lines changed

Zend/tests/bug46106.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ try {
2323
?>
2424
DONE
2525
--EXPECT--
26-
str_pad() expects at least 2 parameters, 1 given
26+
str_pad(): At least 2 arguments are expected, 1 given
2727
DONE

Zend/tests/bug51827.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ register_shutdown_function('exploDe');
1616
--EXPECT--
1717
int(1)
1818

19-
Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 parameters, 0 given in [no active file]:0
19+
Fatal error: Uncaught ArgumentCountError: explode(): At least 2 arguments are expected, 0 given in [no active file]:0
2020
Stack trace:
2121
#0 [internal function]: explode()
2222
#1 {main}

Zend/tests/function_arguments/argument_count_incorrect_internal.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ try {
99
}
1010
?>
1111
--EXPECT--
12-
substr() expects at least 2 parameters, 1 given
12+
substr(): At least 2 arguments are expected, 1 given

Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ try {
1919
?>
2020
--EXPECT--
2121
ArgumentCountError
22-
substr() expects at least 2 parameters, 1 given
22+
substr(): At least 2 arguments are expected, 1 given
2323
ArgumentCountError
2424
At least 2 parameters are required, 1 given

Zend/zend_API.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void) /*
198198
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args) /* {{{ */
199199
{
200200
uint32_t num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
201-
zend_function *active_function = EG(current_execute_data)->func;
202-
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
201+
char *func_name = get_active_function_or_method_name();
203202

204203
zend_argument_count_error(
205-
"%s%s%s() expects %s %d parameter%s, %d given",
206-
class_name, \
207-
class_name[0] ? "::" : "", \
208-
ZSTR_VAL(active_function->common.function_name),
209-
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
210-
num_args < min_num_args ? min_num_args : max_num_args,
211-
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
212-
num_args);
204+
"%s(): %s %d argument%s %s expected, %d given",
205+
func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most",
206+
num_args < min_num_args ? min_num_args : max_num_args,
207+
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
208+
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are",
209+
num_args
210+
);
211+
212+
efree(func_name);
213213
}
214214
/* }}} */
215215

@@ -987,16 +987,16 @@ static int zend_parse_va_args(uint32_t num_args, const char *type_spec, va_list
987987

988988
if (num_args < min_num_args || num_args > max_num_args) {
989989
if (!(flags & ZEND_PARSE_PARAMS_QUIET)) {
990-
zend_function *active_function = EG(current_execute_data)->func;
991-
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
992-
zend_argument_count_error("%s%s%s() expects %s %d parameter%s, %d given",
993-
class_name,
994-
class_name[0] ? "::" : "",
995-
ZSTR_VAL(active_function->common.function_name),
996-
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
997-
num_args < min_num_args ? min_num_args : max_num_args,
998-
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
999-
num_args);
990+
char *func_name = get_active_function_or_method_name();
991+
zend_argument_count_error("%s(): %s %d argument%s %s expected, %d given",
992+
func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most",
993+
num_args < min_num_args ? min_num_args : max_num_args,
994+
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
995+
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are",
996+
num_args
997+
);
998+
999+
efree(func_name);
10001000
}
10011001
return FAILURE;
10021002
}

ext/date/tests/DateTimeZone_construct_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ try {
2121
*** Testing DateTimeZone() : error conditions ***
2222

2323
-- Testing new DateTimeZone() with more than expected no. of arguments --
24-
DateTimeZone::__construct() expects exactly 1 parameter, 2 given
24+
DateTimeZone::__construct(): Exactly 1 argument is expected, 2 given

ext/date/tests/DateTime_construct_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ try {
2222
*** Testing date_create() : error conditions ***
2323

2424
-- Testing new DateTime() with more than expected no. of arguments --
25-
DateTime::__construct() expects at most 2 parameters, 3 given
25+
DateTime::__construct(): At most 2 arguments are expected, 3 given

ext/date/tests/mktime_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ try {
3333
*** Testing mktime() : error conditions ***
3434

3535
-- Testing mktime() function with Zero arguments --
36-
mktime() expects at least 1 parameter, 0 given
36+
mktime(): At least 1 argument is expected, 0 given
3737

3838
-- Testing mktime() function with more than expected no. of arguments --
39-
mktime() expects at most 6 parameters, 7 given
39+
mktime(): At most 6 arguments are expected, 7 given

ext/dom/tests/DOMAttr_construct_error_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414
}
1515
?>
1616
--EXPECT--
17-
DOMAttr::__construct() expects at least 1 parameter, 0 given
17+
DOMAttr::__construct(): At least 1 argument is expected, 0 given

ext/dom/tests/DOMCDATASection_construct_error_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Nic Rosental nicrosental@gmail.com
1414
}
1515
?>
1616
--EXPECT--
17-
DOMCdataSection::__construct() expects exactly 1 parameter, 0 given
17+
DOMCdataSection::__construct(): Exactly 1 argument is expected, 0 given

ext/dom/tests/DOMComment_construct_error_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414
}
1515
?>
1616
--EXPECT--
17-
DOMComment::__construct() expects at most 1 parameter, 2 given
17+
DOMComment::__construct(): At most 1 argument is expected, 2 given

ext/fileinfo/tests/bug61173.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-
finfo::__construct() expects at most 2 parameters, 3 given
18+
finfo::__construct(): At most 2 arguments are expected, 3 given

ext/intl/tests/breakiter___construct_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ try {
4040
--EXPECTF--
4141
Exception: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d
4242

43-
Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d
43+
Exception: IntlRuleBasedBreakIterator::__construct(): At least 1 argument is expected, 0 given in %s on line %d
4444

45-
Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d
45+
Exception: IntlRuleBasedBreakIterator::__construct(): At most 2 arguments are expected, 3 given in %s on line %d
4646

4747
Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($areCompiled) must be of type bool, array given in %s on line %d
4848

ext/intl/tests/calendar_before_after_error.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ try {
6262
}
6363
?>
6464
--EXPECT--
65-
error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given
65+
error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 0 given
6666

67-
error: 0, IntlCalendar::before() expects exactly 1 parameter, 0 given
67+
error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 0 given
6868

6969
error: 0, IntlCalendar::after(): Argument #1 ($calendar) must be of type IntlCalendar, int given
7070

7171
error: 0, IntlCalendar::before(): Argument #1 ($calendar) must be of type IntlCalendar, int given
7272

73-
error: 0, IntlCalendar::after() expects exactly 1 parameter, 2 given
73+
error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 2 given
7474

75-
error: 0, IntlCalendar::before() expects exactly 1 parameter, 2 given
75+
error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 2 given
7676

77-
error: 0, intlcal_after() expects exactly 2 parameters, 1 given
77+
error: 0, intlcal_after(): Exactly 2 arguments are expected, 1 given
7878

79-
error: 0, intlcal_before() expects exactly 2 parameters, 1 given
79+
error: 0, intlcal_before(): Exactly 2 arguments are expected, 1 given

ext/intl/tests/calendar_equals_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ try {
4646
}
4747
?>
4848
--EXPECT--
49-
error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given
49+
error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 0 given
5050

5151
error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, stdClass given
5252

53-
error: 0, IntlCalendar::equals() expects exactly 1 parameter, 2 given
53+
error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 2 given
5454

5555
error: 0, intlcal_equals(): Argument #2 ($calendar) must be of type IntlCalendar, array given
5656

ext/intl/tests/calendar_fieldDifference_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ try {
2727
var_dump(intlcal_field_difference(1, 0, 1));
2828
?>
2929
--EXPECTF--
30-
IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given
30+
IntlCalendar::fieldDifference(): Exactly 2 arguments are expected, 3 given
3131

3232
Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d
3333
bool(false)
34-
intlcal_field_difference() expects exactly 3 parameters, 4 given
34+
intlcal_field_difference(): Exactly 3 arguments are expected, 4 given
3535

3636
Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
3737
Stack trace:

ext/intl/tests/calendar_getLocale_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING);
1313
var_dump(intlcal_get_locale(1));
1414
?>
1515
--EXPECTF--
16-
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s:%d
16+
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale(): Exactly 2 arguments are expected, 1 given in %s:%d
1717
Stack trace:
1818
#0 %s(%d): intlcal_get_locale(1)
1919
#1 {main}

ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ try {
7676
}
7777
?>
7878
--EXPECT--
79-
ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given
80-
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
81-
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given
79+
ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given
80+
ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given
81+
ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given
8282
ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field
8383
ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field
8484
ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field
8585
TypeError: 0, intlcal_get(): Argument #2 ($field) must be of type int, string given
8686
TypeError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be of type int, string given
8787
TypeError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be of type int, string given
88-
ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given
89-
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
90-
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given
88+
ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given
89+
ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given
90+
ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given

ext/intl/tests/calendar_isEquivalentTo_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ try {
5252
--EXPECT--
5353
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given
5454

55-
error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given
55+
error: 0, IntlCalendar::isEquivalentTo(): Exactly 1 argument is expected, 2 given
5656

5757
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given
5858

59-
error: 0, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given
59+
error: 0, intlcal_is_equivalent_to(): Exactly 2 arguments are expected, 1 given
6060

6161
error: 0, intlcal_is_equivalent_to(): Argument #2 ($calendar) must be of type IntlCalendar, int given
6262

ext/intl/tests/calendar_setTimeZone_error.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ try{
4242
}
4343
?>
4444
--EXPECT--
45-
error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given
45+
error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 2 given
4646

47-
error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given
47+
error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 0 given
4848

49-
error: 0, intlcal_set_time_zone() expects exactly 2 parameters, 3 given
49+
error: 0, intlcal_set_time_zone(): Exactly 2 arguments are expected, 3 given
5050

5151
error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given

ext/intl/tests/calendar_setTime_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING);
1313
var_dump(intlcal_set_time(1));
1414
?>
1515
--EXPECTF--
16-
Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 parameters, 1 given in %s:%d
16+
Fatal error: Uncaught ArgumentCountError: intlcal_set_time(): Exactly 2 arguments are expected, 1 given in %s:%d
1717
Stack trace:
1818
#0 %s(%d): intlcal_set_time(1)
1919
#1 {main}

ext/intl/tests/calendar_set_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ try {
4343
}
4444
?>
4545
--EXPECT--
46-
IntlCalendar::set() expects at most 6 parameters, 7 given
46+
IntlCalendar::set(): At most 6 arguments are expected, 7 given
4747
IntlCalendar::set() has no variant with exactly 4 parameters
4848
IntlCalendar::set(): Argument #1 ($year) must be a valid field
4949
intlcal_set(): Argument #2 ($year) must be a valid field

ext/intl/tests/formatter_fail.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ foreach($args as $arg) {
8686

8787
?>
8888
--EXPECTF--
89-
ArgumentCountError: NumberFormatter::__construct() expects at least 2 parameters, 0 given in %s on line %d
89+
ArgumentCountError: NumberFormatter::__construct(): At least 2 arguments are expected, 0 given in %s on line %d
9090
'U_ZERO_ERROR'
9191

92-
ArgumentCountError: numfmt_create() expects at least 2 parameters, 0 given in %s on line %d
92+
ArgumentCountError: numfmt_create(): At least 2 arguments are expected, 0 given in %s on line %d
9393
'U_ZERO_ERROR'
9494

95-
ArgumentCountError: NumberFormatter::create() expects at least 2 parameters, 0 given in %s on line %d
95+
ArgumentCountError: NumberFormatter::create(): At least 2 arguments are expected, 0 given in %s on line %d
9696
'U_ZERO_ERROR'
9797

9898
IntlException: Constructor failed in %s on line %d

ext/intl/tests/msgfmt_fail2.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ foreach($args as $arg) {
108108

109109
?>
110110
--EXPECTF--
111-
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d
111+
ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 0 given in %s on line %d
112112
'U_ZERO_ERROR'
113113

114-
ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d
114+
ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 0 given in %s on line %d
115115
'U_ZERO_ERROR'
116116

117-
ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d
117+
ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 0 given in %s on line %d
118118
'U_ZERO_ERROR'
119119

120-
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d
120+
ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 1 given in %s on line %d
121121
'U_ZERO_ERROR'
122122

123-
ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d
123+
ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 1 given in %s on line %d
124124
'U_ZERO_ERROR'
125125

126-
ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d
126+
ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 1 given in %s on line %d
127127
'U_ZERO_ERROR'
128128

129129
IntlException: Constructor failed in %s on line %d

ext/mysqli/tests/mysqli_fetch_object_oo.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ require_once('skipifconnectfailure.inc');
134134
--EXPECTF--
135135
mysqli object is not fully initialized
136136
[0] Object of class mysqli could not be converted to string in %s on line %d
137-
[0] mysqli_result::fetch_object() expects at most 2 parameters, 3 given in %s on line %d
137+
[0] mysqli_result::fetch_object(): At most 2 arguments are expected, 3 given in %s on line %d
138138
[0] mysqli_result::fetch_object(): Argument #2 ($params) must be of type array, null given in %s on line %d
139139
Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected
140140
NULL

ext/opcache/tests/optimize_func_calls.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ Array
105105
(
106106
[0] => A Object
107107
(
108-
[obj] =>
108+
[obj] =>
109109
)
110110

111111
)
112112
Array
113113
(
114-
[0] =>
114+
[0] =>
115115
)
116116
string(7) "changed"
117117
Array

ext/phar/tests/002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ try {
1717
}
1818
__HALT_COMPILER(); ?>
1919
--EXPECTF--
20-
Phar::mapPhar() expects at most 2 parameters, 3 given
20+
Phar::mapPhar(): At most 2 arguments are expected, 3 given
2121
internal corruption of phar "%s002.php" (truncated manifest at manifest length)

ext/phar/tests/badparameters.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,16 @@ Phar::compress(): Argument #1 ($compression_type) must be of type int, array giv
253253
Cannot compress phar archive, phar is read-only
254254
Phar::compressFiles(): Argument #1 ($compression_type) must be of type int, array given
255255
Phar is readonly, cannot change compression
256-
Phar::copy() expects exactly 2 parameters, 1 given
256+
Phar::copy(): Exactly 2 arguments are expected, 1 given
257257
Cannot copy "a" to "b", phar is read-only
258258
Phar::offsetExists(): Argument #1 ($entry) must be a valid path, array given
259259
Phar::offsetGet(): Argument #1 ($entry) must be a valid path, array given
260-
Phar::offsetSet() expects exactly 2 parameters, 1 given
260+
Phar::offsetSet(): Exactly 2 arguments are expected, 1 given
261261
PharData::offsetUnset(): Argument #1 ($entry) must be a valid path, array given
262262
Write operations disabled by the php.ini setting phar.readonly
263263
Phar::addEmptyDir(): Argument #1 ($dirname) must be a valid path, array given
264264
Phar::addFile(): Argument #1 ($filename) must be a valid path, array given
265-
Phar::addFromString() expects exactly 2 parameters, 1 given
265+
Phar::addFromString(): Exactly 2 arguments are expected, 1 given
266266
Write operations disabled by the php.ini setting phar.readonly
267-
Phar::setMetadata() expects exactly 1 parameter, 2 given
267+
Phar::setMetadata(): Exactly 1 argument is expected, 2 given
268268
Write operations disabled by the php.ini setting phar.readonly

ext/phar/tests/bug60261.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414

1515
?>
1616
--EXPECT--
17-
Phar::__construct() expects at least 1 parameter, 0 given
17+
Phar::__construct(): At least 1 argument is expected, 0 given

ext/reflection/tests/ReflectionClass_constructor_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ try {
4646

4747
?>
4848
--EXPECTF--
49-
ReflectionClass::__construct() expects exactly 1 parameter, 0 given
49+
ReflectionClass::__construct(): Exactly 1 argument is expected, 0 given
5050
Class "" does not exist
5151
Class "1" does not exist
5252
Class "1" does not exist
5353

5454
Warning: Array to string conversion in %s on line %d
5555
Class "Array" does not exist
56-
ReflectionClass::__construct() expects exactly 1 parameter, 2 given
56+
ReflectionClass::__construct(): Exactly 1 argument is expected, 2 given
5757
Class "X" does not exist

0 commit comments

Comments
 (0)