Improve error messages mentioning parameters instead of arguments

Closes GH-5999
This commit is contained in:
Máté Kocsis 2020-08-16 21:49:20 +02:00
parent c5b42be40e
commit 9975986b7e
No known key found for this signature in database
GPG key ID: FD055E41728BF310
143 changed files with 473 additions and 452 deletions

View file

@ -135,10 +135,10 @@ PHP 8.0 UPGRADE NOTES
. Uncaught exceptions now go through "clean shutdown", which means that
destructors will be called after an uncaught exception.
. Compile time fatal error "Only variables can be passed by reference" has
been delayed until runtime and converted to "Cannot pass parameter by
been delayed until runtime and converted to "Argument cannot be passed by
reference" exception.
. Some "Only variables should be passed by reference" notices have been
converted to "Cannot pass parameter by reference" exception.
converted to "Argument cannot be passed by reference" exception.
. The generated name for anonymous classes has changed. It will now include
the name of the first parent or interface:

View file

@ -23,5 +23,5 @@ try {
?>
DONE
--EXPECT--
str_pad() expects at least 2 parameters, 1 given
str_pad() expects at least 2 arguments, 1 given
DONE

View file

@ -16,7 +16,7 @@ register_shutdown_function('exploDe');
--EXPECT--
int(1)
Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 parameters, 0 given in [no active file]:0
Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 arguments, 0 given in [no active file]:0
Stack trace:
#0 [internal function]: explode()
#1 {main}

View file

@ -6,28 +6,25 @@ Bug #72038 (Function calls with values to a by-ref parameter don't always throw
try {
test($foo = new stdClass);
var_dump($foo);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
try {
test($bar = 2);
var_dump($bar);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
test($baz = &$bar);
var_dump($baz);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
test($baz = &$bar);
var_dump($baz);
function test(&$param) {
$param = 1;
}
?>
--EXPECT--
Exception: Cannot pass parameter 1 by reference
Exception: Cannot pass parameter 1 by reference
test(): Argument #1 ($param) cannot be passed by reference
test(): Argument #1 ($param) cannot be passed by reference
int(1)

View file

@ -13,4 +13,4 @@ try {
}
?>
--EXPECT--
func_get_args() expects exactly 0 parameters, 4 given
func_get_args() expects exactly 0 arguments, 4 given

View file

@ -12,7 +12,7 @@ change(list($val) = $array);
var_dump($array);
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
Fatal error: Uncaught Error: change(): Argument #1 ($ref) cannot be passed by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -22,5 +22,5 @@ namespace Foo {
?>
--EXPECT--
Exception: Cannot pass parameter 3 by reference
Exception: Cannot pass parameter 3 by reference
Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference
Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference

View file

@ -5,7 +5,7 @@ Bug #79783: Segfault in php_str_replace_common
str_replace("a", "b", "c", strlen("d"));
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot pass parameter 4 by reference in %s:%d
Fatal error: Uncaught Error: str_replace(): Argument #4 ($replace_count) cannot be passed by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -26,7 +26,7 @@ int(9)
Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4
int(81)
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
Fatal error: Uncaught Error: {closure}(): Argument #1 ($x) cannot be passed by reference in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}

View file

@ -11,7 +11,7 @@ foo(1);
echo "Done\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
Fatal error: Uncaught Error: foo(): Argument #1 ($var) cannot be passed by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -9,4 +9,4 @@ try {
}
?>
--EXPECT--
substr() expects at least 2 parameters, 1 given
substr() expects at least 2 arguments, 1 given

View file

@ -19,6 +19,6 @@ try {
?>
--EXPECT--
ArgumentCountError
substr() expects at least 2 parameters, 1 given
substr() expects at least 2 arguments, 1 given
ArgumentCountError
At least 2 parameters are required, 1 given
At least 2 arguments are required, 1 given

View file

@ -15,4 +15,4 @@ try {
?>
--EXPECTF--
Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
Warning: count(): Argument #1 ($var) must be of type Countable|array, Generator given in %s on line %d

View file

@ -30,8 +30,8 @@ main();
usesValue 0
i is 0
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s027.php:20
Fatal error: Uncaught Error: Test::usesRef(): Argument #1 ($x) cannot be passed by reference in %s:%d
Stack trace:
#0 %s027.php(23): main()
#0 %s(%d): main()
#1 {main}
thrown in %s027.php on line 20
thrown in %s on line %d

View file

@ -34,4 +34,4 @@ try {
usesValue 42
usesValue 42
int(42)
Caught Cannot pass parameter 1 by reference
Caught Test::usesRef(): Argument #1 ($x) cannot be passed by reference

View file

@ -10,4 +10,4 @@ try {
}
?>
--EXPECT--
Cannot pass parameter 2 by reference
test(): Argument #2 ($e) cannot be passed by reference

View file

@ -50,10 +50,10 @@ int(0)
string(98) "call_user_func_array(): Argument #1 ($function) must be a valid callback, no array or string given"
string(77) "call_user_func_array(): Argument #2 ($args) must be of type array, null given"
string(69) "get_class(): Argument #1 ($object) must be of type object, null given"
string(56) "get_called_class() expects exactly 0 parameters, 1 given"
string(55) "get_called_class() expects exactly 0 arguments, 1 given"
string(4) "NULL"
string(53) "func_num_args() expects exactly 0 parameters, 1 given"
string(53) "func_get_args() expects exactly 0 parameters, 1 given"
string(52) "func_num_args() expects exactly 0 arguments, 1 given"
string(52) "func_get_args() expects exactly 0 arguments, 1 given"
string(69) "array_slice(): Argument #1 ($array) must be of type array, null given"
array(1) {
[0]=>

View file

@ -29,7 +29,7 @@ test(new Foo());
?>
--EXPECT--
Cannot pass parameter 1 by reference
Cannot pass parameter 1 by reference
Cannot pass parameter 1 by reference
Cannot pass parameter 1 by reference
set(): Argument #1 ($ref) cannot be passed by reference
set(): Argument #1 ($ref) cannot be passed by reference
set(): Argument #1 ($ref) cannot be passed by reference
set(): Argument #1 ($ref) cannot be passed by reference

View file

@ -9,7 +9,7 @@ test(1);
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
Fatal error: Uncaught Error: test(): Argument #1 cannot be passed by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -183,33 +183,29 @@ ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg) /* {{{ */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* {{{ */
{
int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_string *func_name = get_active_function_or_method_name();
zend_argument_count_error(
"%s%s%s() expects exactly 0 parameters, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
num_args);
zend_argument_count_error("%s() expects exactly 0 arguments, %d given", ZSTR_VAL(func_name), num_args);
zend_string_release(func_name);
}
/* }}} */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args) /* {{{ */
{
uint32_t num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_string *func_name = get_active_function_or_method_name();
zend_argument_count_error(
"%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
"%s() expects %s %d argument%s, %d given",
ZSTR_VAL(func_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args
);
zend_string_release(func_name);
}
/* }}} */
@ -325,23 +321,23 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void)
static ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va) /* {{{ */
{
const char *space;
const char *class_name;
zend_string *func_name;
const char *arg_name;
char *message = NULL;
if (EG(exception)) {
return;
}
class_name = get_active_class_name(&space);
func_name = get_active_function_or_method_name();
arg_name = get_active_function_arg_name(arg_num);
zend_vspprintf(&message, 0, format, va);
zend_throw_error(error_ce, "%s%s%s(): Argument #%d%s%s%s %s",
class_name, space, get_active_function_name(), arg_num,
zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s",
ZSTR_VAL(func_name), arg_num,
arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message
);
efree(message);
zend_string_release(func_name);
}
/* }}} */
@ -1005,16 +1001,17 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec,
if (num_args < min_num_args || num_args > max_num_args) {
if (!(flags & ZEND_PARSE_PARAMS_QUIET)) {
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_argument_count_error("%s%s%s() expects %s %d parameter%s, %d given",
class_name,
class_name[0] ? "::" : "",
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
zend_string *func_name = get_active_function_or_method_name();
zend_argument_count_error("%s() expects %s %d argument%s, %d given",
ZSTR_VAL(func_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args
);
zend_string_release(func_name);
}
return FAILURE;
}

View file

@ -583,6 +583,19 @@ static zend_never_inline ZEND_COLD bool zend_wrong_assign_to_variable_reference(
return 1;
}
ZEND_API ZEND_COLD void zend_cannot_pass_by_reference(uint32_t arg_num)
{
const zend_execute_data *execute_data = EG(current_execute_data);
zend_string *func_name = get_function_or_method_name(EX(call)->func);
const char *param_name = get_function_arg_name(EX(call)->func, arg_num);
zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference",
ZSTR_VAL(func_name), arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : ""
);
zend_string_release(func_name);
}
static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_prop_error(zend_property_info *prop, const char *type) {
zend_string *type_str = zend_type_to_string(prop->type);
zend_type_error(

View file

@ -311,11 +311,14 @@ ZEND_API const char *get_active_class_name(const char **space);
ZEND_API const char *get_active_function_name(void);
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num);
ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num);
ZEND_API zend_string *get_active_function_or_method_name();
ZEND_API zend_string *get_function_or_method_name(const zend_function *func);
ZEND_API const char *zend_get_executed_filename(void);
ZEND_API zend_string *zend_get_executed_filename_ex(void);
ZEND_API uint32_t zend_get_executed_lineno(void);
ZEND_API zend_class_entry *zend_get_executed_scope(void);
ZEND_API zend_bool zend_is_executing(void);
ZEND_API ZEND_COLD void zend_cannot_pass_by_reference(uint32_t arg_num);
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
ZEND_API void zend_unset_timeout(void);

View file

@ -443,6 +443,7 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */
}
func = EG(current_execute_data)->func;
switch (func->type) {
case ZEND_USER_FUNCTION:
case ZEND_INTERNAL_FUNCTION:
@ -470,7 +471,9 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */
if (!zend_is_executing()) {
return NULL;
}
func = EG(current_execute_data)->func;
switch (func->type) {
case ZEND_USER_FUNCTION: {
zend_string *function_name = func->common.function_name;
@ -491,6 +494,24 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */
}
/* }}} */
ZEND_API zend_string *get_active_function_or_method_name(void) /* {{{ */
{
ZEND_ASSERT(zend_is_executing());
return get_function_or_method_name(EG(current_execute_data)->func);
}
/* }}} */
ZEND_API zend_string *get_function_or_method_name(const zend_function *func) /* {{{ */
{
if (func->common.scope) {
return zend_create_member_string(func->common.scope->name, func->common.function_name);
}
return func->common.function_name ? zend_string_copy(func->common.function_name) : zend_string_init("main", sizeof("main") - 1, 0);
}
/* }}} */
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num) /* {{{ */
{
zend_function *func;

View file

@ -4596,7 +4596,8 @@ ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num,
USE_OPLINE
SAVE_OPLINE();
zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num);
zend_cannot_pass_by_reference(_arg_num);
FREE_OP1();
ZVAL_UNDEF(_arg);
HANDLE_EXCEPTION();
@ -8918,7 +8919,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
} else {
count = 1;
}
zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}

View file

@ -2283,7 +2283,8 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_ca
USE_OPLINE
SAVE_OPLINE();
zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num);
zend_cannot_pass_by_reference(_arg_num);
FREE_OP(opline->op1_type, opline->op1.var);
ZVAL_UNDEF(_arg);
HANDLE_EXCEPTION();
@ -10564,7 +10565,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
} else {
count = 1;
}
zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}
@ -17877,7 +17878,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
} else {
count = 1;
}
zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}
@ -48242,7 +48243,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
} else {
count = 1;
}
zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}

View file

@ -21,4 +21,4 @@ try {
*** Testing DateTimeZone() : error conditions ***
-- Testing new DateTimeZone() with more than expected no. of arguments --
DateTimeZone::__construct() expects exactly 1 parameter, 2 given
DateTimeZone::__construct() expects exactly 1 argument, 2 given

View file

@ -22,4 +22,4 @@ try {
*** Testing date_create() : error conditions ***
-- Testing new DateTime() with more than expected no. of arguments --
DateTime::__construct() expects at most 2 parameters, 3 given
DateTime::__construct() expects at most 2 arguments, 3 given

View file

@ -33,7 +33,7 @@ try {
*** Testing mktime() : error conditions ***
-- Testing mktime() function with Zero arguments --
mktime() expects at least 1 parameter, 0 given
mktime() expects at least 1 argument, 0 given
-- Testing mktime() function with more than expected no. of arguments --
mktime() expects at most 6 parameters, 7 given
mktime() expects at most 6 arguments, 7 given

View file

@ -14,4 +14,4 @@ try {
}
?>
--EXPECT--
DOMAttr::__construct() expects at least 1 parameter, 0 given
DOMAttr::__construct() expects at least 1 argument, 0 given

View file

@ -14,4 +14,4 @@ Nic Rosental nicrosental@gmail.com
}
?>
--EXPECT--
DOMCdataSection::__construct() expects exactly 1 parameter, 0 given
DOMCdataSection::__construct() expects exactly 1 argument, 0 given

View file

@ -14,4 +14,4 @@ try {
}
?>
--EXPECT--
DOMComment::__construct() expects at most 1 parameter, 2 given
DOMComment::__construct() expects at most 1 argument, 2 given

View file

@ -14,4 +14,4 @@ try {
}
?>
--EXPECT--
DOMDocumentFragment::__construct() expects exactly 0 parameters, 1 given
DOMDocumentFragment::__construct() expects exactly 0 arguments, 1 given

View file

@ -15,4 +15,4 @@ try {
}
?>
--EXPECT--
finfo::__construct() expects at most 2 parameters, 3 given
finfo::__construct() expects at most 2 arguments, 3 given

View file

@ -41,7 +41,7 @@ var_dump(imap_timeout(IMAP_WRITETIMEOUT));
--EXPECTF--
Checking with no parameters
Warning: imap_timeout() expects at least 1 parameter, 0 given in %s on line %d
Warning: imap_timeout() expects at least 1 argument, 0 given in %s on line %d
Checking with incorrect parameter type
Warning: imap_timeout(): Argument #1 must be of type int, %s given in %s on line %d

View file

@ -46,9 +46,9 @@ try {
--EXPECTF--
Exception: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($areCompiled) must be of type bool, array given in %s on line %d

View file

@ -62,18 +62,18 @@ try {
}
?>
--EXPECT--
error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given
error: 0, IntlCalendar::after() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::before() expects exactly 1 parameter, 0 given
error: 0, IntlCalendar::before() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::after(): Argument #1 ($calendar) must be of type IntlCalendar, int given
error: 0, IntlCalendar::before(): Argument #1 ($calendar) must be of type IntlCalendar, int given
error: 0, IntlCalendar::after() expects exactly 1 parameter, 2 given
error: 0, IntlCalendar::after() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::before() expects exactly 1 parameter, 2 given
error: 0, IntlCalendar::before() expects exactly 1 argument, 2 given
error: 0, intlcal_after() expects exactly 2 parameters, 1 given
error: 0, intlcal_after() expects exactly 2 arguments, 1 given
error: 0, intlcal_before() expects exactly 2 parameters, 1 given
error: 0, intlcal_before() expects exactly 2 arguments, 1 given

View file

@ -46,11 +46,11 @@ try {
}
?>
--EXPECT--
error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given
error: 0, IntlCalendar::equals() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, stdClass given
error: 0, IntlCalendar::equals() expects exactly 1 parameter, 2 given
error: 0, IntlCalendar::equals() expects exactly 1 argument, 2 given
error: 0, intlcal_equals(): Argument #2 ($calendar) must be of type IntlCalendar, array given

View file

@ -27,11 +27,11 @@ try {
var_dump(intlcal_field_difference(1, 0, 1));
?>
--EXPECTF--
IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given
IntlCalendar::fieldDifference() expects exactly 2 arguments, 3 given
Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d
bool(false)
intlcal_field_difference() expects exactly 3 parameters, 4 given
intlcal_field_difference() expects exactly 3 arguments, 4 given
Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:

View file

@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_locale(1));
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s:%d
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 arguments, 1 given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_locale(1)
#1 {main}

View file

@ -76,15 +76,15 @@ try {
}
?>
--EXPECT--
ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given
ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field
TypeError: 0, intlcal_get(): Argument #2 ($field) must be of type int, string given
TypeError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be of type int, string given
TypeError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be of type int, string given
ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given

View file

@ -52,11 +52,11 @@ try {
--EXPECT--
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given
error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given
error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given
error: 0, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given
error: 0, intlcal_is_equivalent_to() expects exactly 2 arguments, 1 given
error: 0, intlcal_is_equivalent_to(): Argument #2 ($calendar) must be of type IntlCalendar, int given

View file

@ -42,10 +42,10 @@ try{
}
?>
--EXPECT--
error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given
error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given
error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 0 given
error: 0, intlcal_set_time_zone() expects exactly 2 parameters, 3 given
error: 0, intlcal_set_time_zone() expects exactly 2 arguments, 3 given
error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_set_time(1));
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 parameters, 1 given in %s:%d
Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 arguments, 1 given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_time(1)
#1 {main}

View file

@ -43,7 +43,7 @@ try {
}
?>
--EXPECT--
IntlCalendar::set() expects at most 6 parameters, 7 given
IntlCalendar::set() expects at most 6 arguments, 7 given
IntlCalendar::set() has no variant with exactly 4 parameters
IntlCalendar::set(): Argument #1 ($year) must be a valid field
intlcal_set(): Argument #2 ($year) must be a valid field

View file

@ -95,13 +95,13 @@ foreach($args as $arg) {
?>
--EXPECTF--
ArgumentCountError: NumberFormatter::__construct() expects at least 2 parameters, 0 given in %s on line %d
ArgumentCountError: NumberFormatter::__construct() expects at least 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: numfmt_create() expects at least 2 parameters, 0 given in %s on line %d
ArgumentCountError: numfmt_create() expects at least 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: NumberFormatter::create() expects at least 2 parameters, 0 given in %s on line %d
ArgumentCountError: NumberFormatter::create() expects at least 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
Error: NumberFormatter object is already constructed in %s on line %d

View file

@ -108,22 +108,22 @@ foreach($args as $arg) {
?>
--EXPECTF--
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d
ArgumentCountError: msgfmt_create() expects exactly 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d
ArgumentCountError: MessageFormatter::create() expects exactly 2 arguments, 0 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d
ArgumentCountError: MessageFormatter::__construct() expects exactly 2 arguments, 1 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d
ArgumentCountError: msgfmt_create() expects exactly 2 arguments, 1 given in %s on line %d
'U_ZERO_ERROR'
ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d
ArgumentCountError: MessageFormatter::create() expects exactly 2 arguments, 1 given in %s on line %d
'U_ZERO_ERROR'
IntlException: Constructor failed in %s on line %d

View file

@ -14,4 +14,4 @@ try {
?>
--EXPECT--
int(0)
json_last_error() expects exactly 0 parameters, 1 given
json_last_error() expects exactly 0 arguments, 1 given

View file

@ -14,4 +14,4 @@ try {
?>
--EXPECT--
string(8) "No error"
json_last_error_msg() expects exactly 0 parameters, 1 given
json_last_error_msg() expects exactly 0 arguments, 1 given

View file

@ -40,5 +40,5 @@ require_once('skipifconnectfailure.inc');
print "done!";
?>
--EXPECT--
mysqli_connect_errno() expects exactly 0 parameters, 1 given
mysqli_connect_errno() expects exactly 0 arguments, 1 given
done!

View file

@ -39,5 +39,5 @@ require_once('skipifconnectfailure.inc');
print "done!";
?>
--EXPECT--
mysqli_connect_error() expects exactly 0 parameters, 1 given
mysqli_connect_error() expects exactly 0 arguments, 1 given
done!

View file

@ -134,7 +134,7 @@ require_once('skipifconnectfailure.inc');
--EXPECTF--
mysqli object is not fully initialized
[0] Object of class mysqli could not be converted to string in %s on line %d
[0] mysqli_result::fetch_object() expects at most 2 parameters, 3 given in %s on line %d
[0] mysqli_result::fetch_object() expects at most 2 arguments, 3 given in %s on line %d
[0] mysqli_result::fetch_object(): Argument #2 ($params) must be of type array, null given in %s on line %d
Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected
NULL

View file

@ -208,7 +208,7 @@ mysqli_query($link, 'DROP USER pcontest');
mysqli_close($link);
?>
--EXPECT--
mysqli_get_links_stats() expects exactly 0 parameters, 1 given
mysqli_get_links_stats() expects exactly 0 arguments, 1 given
Before pconnect:array(3) {
["total"]=>
int(1)

View file

@ -28,7 +28,7 @@ var_dump($array);
echo "Done\n";
?>
--EXPECTF--
oci_bind_array_by_name() expects at most 6 parameters, 7 given
oci_bind_array_by_name() expects at most 6 arguments, 7 given
Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
bool(false)

View file

@ -1912,20 +1912,8 @@ static int zend_jit_throw_cannot_pass_by_ref_stub(dasm_State **Dst)
| mov EX->call, RX
|1:
| mov RX, r0
|.if X64
| xor CARG1, CARG1
| LOAD_ADDR CARG2, "Cannot pass parameter %d by reference"
| mov CARG3d, dword OP:r0->op2.num
| EXT_CALL zend_throw_error, r0
|.else
| mov r1, dword OP:r0->op2.num
| sub r4, 4
| push r1
| push "Cannot pass parameter %d by reference"
| push 0
| EXT_CALL zend_throw_error, r0
| add r4, 16
|.endif
| mov FCARG1d, dword OP:r0->op2.num
| EXT_CALL zend_cannot_pass_by_reference, r0
| cmp byte OP:RX->op1_type, IS_TMP_VAR
| jne >9
|.if X64
@ -8991,7 +8979,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
if (call_num_args <= func->op_array.num_args) {
if (!trace || (trace->op == ZEND_JIT_TRACE_END
if (!trace || (trace->op == ZEND_JIT_TRACE_END
&& trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) {
uint32_t num_args;
@ -9040,7 +9028,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
}
} else {
if (!trace || (trace->op == ZEND_JIT_TRACE_END
if (!trace || (trace->op == ZEND_JIT_TRACE_END
&& trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) {
if (func && zend_accel_in_shm(func->op_array.opcodes)) {
| LOAD_IP_ADDR (func->op_array.opcodes)

View file

@ -128,7 +128,7 @@ Array
string(7) "changed"
string(7) "changed"
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %soptimize_func_calls.php:%d
Fatal error: Uncaught Error: ref(): Argument #1 ($b) cannot be passed by reference in %soptimize_func_calls.php:%d
Stack trace:
#0 {main}
thrown in %soptimize_func_calls.php on line %d

View file

@ -15,5 +15,5 @@ try {
?>
DONE
--EXPECT--
openssl_seal() expects at least 5 parameters, 4 given
openssl_seal() expects at least 5 arguments, 4 given
DONE

View file

@ -17,7 +17,7 @@ echo "Done";
--EXPECTF--
*** Testing preg_match_all() : error conditions ***
Fatal error: Uncaught Error: Cannot pass parameter 3 by reference in %s:%d
Fatal error: Uncaught Error: preg_match_all(): Argument #3 ($subpatterns) cannot be passed by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -17,7 +17,7 @@ $stmt = $db->prepare("SELECT 1");
$stmt->bindParam(':a', 'b');
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot pass parameter 2 by reference in %sbug_37445.php:%d
Fatal error: Uncaught Error: PDOStatement::bindParam(): Argument #2 ($param) cannot be passed by reference in %sbug_37445.php:%d
Stack trace:
#0 {main}
thrown in %sbug_37445.php on line %d

View file

@ -39,7 +39,7 @@ SQL
printf("[002] Expecting false got %s\n", var_export($tmp, true));
$stmt->execute();
// Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 0 given in
// Warning: PDOStatement::getColumnMeta() expects exactly 1 argument, 0 given in
if (false !== ($tmp = @$stmt->getColumnMeta()))
printf("[003] Expecting false got %s\n", var_export($tmp, true));
@ -51,7 +51,7 @@ SQL
if (false !== ($tmp = @$stmt->getColumnMeta(array())))
printf("[005] Expecting false got %s\n", var_export($tmp, true));
// Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 2 given in
// Warning: PDOStatement::getColumnMeta() expects exactly 1 argument, 2 given in
if (false !== ($tmp = @$stmt->getColumnMeta(1, 1)))
printf("[006] Expecting false got %s\n", var_export($tmp, true));

View file

@ -17,5 +17,5 @@ try {
}
__HALT_COMPILER(); ?>
--EXPECTF--
Phar::mapPhar() expects at most 2 parameters, 3 given
Phar::mapPhar() expects at most 2 arguments, 3 given
internal corruption of phar "%s002.php" (truncated manifest at manifest length)

View file

@ -253,16 +253,16 @@ Phar::compress(): Argument #1 ($compression_type) must be of type int, array giv
Cannot compress phar archive, phar is read-only
Phar::compressFiles(): Argument #1 ($compression_type) must be of type int, array given
Phar is readonly, cannot change compression
Phar::copy() expects exactly 2 parameters, 1 given
Phar::copy() expects exactly 2 arguments, 1 given
Cannot copy "a" to "b", phar is read-only
Phar::offsetExists(): Argument #1 ($entry) must be of type string, array given
Phar::offsetGet(): Argument #1 ($entry) must be of type string, array given
Phar::offsetSet() expects exactly 2 parameters, 1 given
Phar::offsetSet() expects exactly 2 arguments, 1 given
PharData::offsetUnset(): Argument #1 ($entry) must be of type string, array given
Write operations disabled by the php.ini setting phar.readonly
Phar::addEmptyDir(): Argument #1 ($dirname) must be of type string, array given
Phar::addFile(): Argument #1 ($filename) must be of type string, array given
Phar::addFromString() expects exactly 2 parameters, 1 given
Phar::addFromString() expects exactly 2 arguments, 1 given
Write operations disabled by the php.ini setting phar.readonly
Phar::setMetadata() expects exactly 1 parameter, 2 given
Phar::setMetadata() expects exactly 1 argument, 2 given
Write operations disabled by the php.ini setting phar.readonly

View file

@ -14,4 +14,4 @@ try {
?>
--EXPECT--
Phar::__construct() expects at least 1 parameter, 0 given
Phar::__construct() expects at least 1 argument, 0 given

View file

@ -46,10 +46,10 @@ try {
?>
--EXPECT--
ReflectionClass::__construct() expects exactly 1 parameter, 0 given
ReflectionClass::__construct() expects exactly 1 argument, 0 given
Class "" does not exist
Class "1" does not exist
Class "1" does not exist
ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given
ReflectionClass::__construct() expects exactly 1 parameter, 2 given
ReflectionClass::__construct() expects exactly 1 argument, 2 given
Class "X" does not exist

View file

@ -56,8 +56,8 @@ try {
?>
--EXPECT--
Check invalid params:
ReflectionClass::getMethod() expects exactly 1 parameter, 0 given
ReflectionClass::getMethod() expects exactly 1 parameter, 2 given
ReflectionClass::getMethod() expects exactly 1 argument, 0 given
ReflectionClass::getMethod() expects exactly 1 argument, 2 given
Method C::() does not exist
Method C::1() does not exist
Method C::1.5() does not exist

View file

@ -54,8 +54,8 @@ try {
?>
--EXPECT--
Check invalid params:
ReflectionClass::getProperty() expects exactly 1 parameter, 0 given
ReflectionClass::getProperty() expects exactly 1 parameter, 2 given
ReflectionClass::getProperty() expects exactly 1 argument, 0 given
ReflectionClass::getProperty() expects exactly 1 argument, 2 given
Property C::$ does not exist
Property C::$1 does not exist
Property C::$1.5 does not exist

View file

@ -39,8 +39,8 @@ try {
?>
--EXPECT--
ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given
ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given
ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given
ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given
Property C::$ does not exist
string(3) "def"
ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given

View file

@ -144,8 +144,8 @@ Does I2 implement I2?
Test bad arguments:
ReflectionClass::implementsInterface() expects exactly 1 parameter, 0 given
ReflectionClass::implementsInterface() expects exactly 1 parameter, 2 given
ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given
ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given
Interface "" does not exist
Interface "ThisClassDoesNotExist" does not exist
Interface "2" does not exist

View file

@ -37,8 +37,8 @@ try {
?>
--EXPECT--
Test bad arguments:
ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given
ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given
ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given
ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given
Class "" does not exist
Class "ThisClassDoesNotExist" does not exist
Class "2" does not exist

View file

@ -44,9 +44,9 @@ try {
?>
--EXPECT--
ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 3 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 0 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 1 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given
Class C does not have a property named
Class C does not have a property named 1.5
ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given

View file

@ -25,7 +25,7 @@ try {
?>
--EXPECTF--
Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given
Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given
--EXPECT--
Ok - ReflectionExtension::__construct() expects exactly 1 argument, 0 given
Ok - ReflectionExtension::__construct() expects exactly 1 argument, 2 given
Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given

View file

@ -37,6 +37,6 @@ try {
--EXPECT--
Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given
Function nonExistentFunction() does not exist
Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 0 given
Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 2 given
Ok - ReflectionFunction::__construct() expects exactly 1 argument, 0 given
Ok - ReflectionFunction::__construct() expects exactly 1 argument, 2 given
Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given

View file

@ -19,5 +19,5 @@ try {
?>
--EXPECT--
Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given
Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given
Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given
Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given

View file

@ -52,10 +52,10 @@ try{
?>
--EXPECT--
Too few arguments:
Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given
Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given
Too many arguments:
Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given
Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given
Ok - Class "InvalidClassName" does not exist
Ok - ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given
Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 2 given
Ok - ReflectionMethod::__construct() expects exactly 1 argument, 2 given

View file

@ -102,7 +102,7 @@ Called methodWithArgs(1, arg2)
NULL
Static method:
ReflectionMethod::invoke() expects at least 1 parameter, 0 given
ReflectionMethod::invoke() expects at least 1 argument, 0 given
ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, bool given
Called staticMethod()
Exception: Using $this when not in object context

View file

@ -37,8 +37,8 @@ try {
?>
--EXPECT--
Test bad arguments:
ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given
ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given
ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given
ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given
Class "" does not exist
Class "ThisClassDoesNotExist" does not exist
Class "2" does not exist

View file

@ -43,6 +43,6 @@ echo "Done.\n";
Class "A" does not exist
Method C::b() does not exist
Method C::b() does not exist
Ok - ReflectionParameter::__construct() expects exactly 2 parameters, 1 given
Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given
Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given
Done.

View file

@ -26,6 +26,6 @@ try {
?>
--EXPECT--
Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 0 given
Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 1 given
Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 3 given
Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 0 given
Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 1 given
Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 3 given

View file

@ -57,7 +57,7 @@ try {
Instance without property:
Static property / too many args:
ReflectionProperty::getValue() expects at most 1 parameter, 2 given
ReflectionProperty::getValue() expects at most 1 argument, 2 given
Protected property:
Cannot access non-public property TestClass::$prot

View file

@ -45,7 +45,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i
Open
Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d
SessionHandler::open() expects exactly 2 parameters, 0 given
SessionHandler::open() expects exactly 2 arguments, 0 given
Warning: Undefined variable $_SESSION in %s on line %d
string(0) ""

View file

@ -47,7 +47,7 @@ int(2)
array(0) {
}
Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 parameters, 1 given in %s:%d
Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 arguments, 1 given in %s:%d
Stack trace:
#0 %s(%d): SessionHandler->close(false)
#1 [internal function]: MySession->close()

View file

@ -69,7 +69,7 @@ $session->max_oids = 0;
var_dump($session->max_oids);
?>
--EXPECTF--
SNMP::__construct() expects at least 3 parameters, 2 given
SNMP::__construct() expects at least 3 arguments, 2 given
SNMP::__construct(): Argument #4 ($timeout) must be of type int, string given
SNMP::__construct(): Argument #5 ($retries) must be of type int, string given
SNMP::__construct(): Argument #1 ($version) must be a valid SNMP protocol version

View file

@ -40,5 +40,5 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>fopen() expects at least 2 parameters, 0 given</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>fopen() expects at least 2 arguments, 0 given</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok

View file

@ -31,7 +31,7 @@ $s_w = socket_connect($s_c, '0.0.0.0', $port);
socket_close($s_c);
?>
--EXPECTF--
socket_connect() expects at least 2 parameters, 1 given
socket_connect() expects at least 2 arguments, 1 given
socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET
Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d

View file

@ -13,4 +13,4 @@ try {
}
?>
--EXPECT--
sodium_bin2hex() expects exactly 1 parameter, 0 given
sodium_bin2hex() expects exactly 1 argument, 0 given

View file

@ -7,7 +7,7 @@ new AppendIterator(null);
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: AppendIterator::__construct() expects exactly 0 parameters, 1 given in %s:%d
Fatal error: Uncaught ArgumentCountError: AppendIterator::__construct() expects exactly 0 arguments, 1 given in %s:%d
Stack trace:
#0 %s(%d): AppendIterator->__construct(NULL)
#1 {main}

View file

@ -42,8 +42,8 @@ try {
}
?>
--EXPECT--
CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given
CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given
CallbackFilterIterator::__construct() expects exactly 2 arguments, 0 given
CallbackFilterIterator::__construct() expects exactly 2 arguments, 1 given
CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, no array or string given
CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, array must have exactly two members
some message

View file

@ -19,4 +19,4 @@ try {
?>
--EXPECT--
Too many arguments:
ArrayObject::__construct() expects at most 3 parameters, 4 given(12)
ArrayObject::__construct() expects at most 3 arguments, 4 given(12)

View file

@ -81,7 +81,7 @@ array(2) {
--> exchangeArray() with no arg:
Exception: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given
Exception: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given
Warning: Undefined variable $copy in %s on line %d
object(ArrayObject)#2 (1) {

View file

@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) {
string(5) "boo22"
}
}
ArrayObject::natcasesort() expects exactly 0 parameters, 1 given
ArrayObject::natcasesort() expects exactly 0 arguments, 1 given
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(5) {

View file

@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) {
string(5) "boo22"
}
}
ArrayObject::natsort() expects exactly 0 parameters, 1 given
ArrayObject::natsort() expects exactly 0 arguments, 1 given
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(5) {

View file

@ -22,5 +22,5 @@ try {
}
?>
--EXPECT--
ArrayObject::uasort() expects exactly 1 parameter, 0 given
ArrayObject::uasort() expects exactly 1 parameter, 2 given
ArrayObject::uasort() expects exactly 1 argument, 0 given
ArrayObject::uasort() expects exactly 1 argument, 2 given

View file

@ -22,5 +22,5 @@ try {
}
?>
--EXPECT--
ArrayObject::uksort() expects exactly 1 parameter, 0 given
ArrayObject::uksort() expects exactly 1 parameter, 2 given
ArrayObject::uksort() expects exactly 1 argument, 0 given
ArrayObject::uksort() expects exactly 1 argument, 2 given

View file

@ -56,9 +56,9 @@ try {
?>
--EXPECT--
FilterIterator::__construct() expects exactly 1 parameter, 0 given
CachingIterator::__construct() expects at least 1 parameter, 0 given
RecursiveCachingIterator::__construct() expects at least 1 parameter, 0 given
ParentIterator::__construct() expects exactly 1 parameter, 0 given
LimitIterator::__construct() expects at least 1 parameter, 0 given
NoRewindIterator::__construct() expects exactly 1 parameter, 0 given
FilterIterator::__construct() expects exactly 1 argument, 0 given
CachingIterator::__construct() expects at least 1 argument, 0 given
RecursiveCachingIterator::__construct() expects at least 1 argument, 0 given
ParentIterator::__construct() expects exactly 1 argument, 0 given
LimitIterator::__construct() expects at least 1 argument, 0 given
NoRewindIterator::__construct() expects exactly 1 argument, 0 given

View file

@ -15,4 +15,4 @@ try {
}
?>
--EXPECT--
RecursiveIteratorIterator::__construct() expects at least 1 parameter, 0 given
RecursiveIteratorIterator::__construct() expects at least 1 argument, 0 given

View file

@ -11,4 +11,4 @@ try {
}
?>
--EXPECT--
RecursiveTreeIterator::__construct() expects at least 1 parameter, 0 given
RecursiveTreeIterator::__construct() expects at least 1 argument, 0 given

View file

@ -86,4 +86,4 @@ int(4)
===ERRORS===
iterator_apply(): Argument #3 ($args) must be of type ?array, int given
iterator_apply(): Argument #2 ($function) must be a valid callback, function "non_existing_function" not found or invalid function name
iterator_apply() expects at most 3 parameters, 4 given
iterator_apply() expects at most 3 arguments, 4 given

View file

@ -21,4 +21,4 @@ try {
?>
--EXPECT--
IteratorIterator::__construct() expects at most 2 parameters, 3 given
IteratorIterator::__construct() expects at most 2 arguments, 3 given

View file

@ -16,4 +16,4 @@ try {
?>
--EXPECT--
string(60) "SQLite3::__construct() expects at least 1 parameter, 0 given"
string(59) "SQLite3::__construct() expects at least 1 argument, 0 given"

View file

@ -745,7 +745,7 @@ PHP_FUNCTION(count)
switch (Z_TYPE_P(array)) {
case IS_NULL:
/* Intentionally not converted to an exception */
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array));
RETURN_LONG(0);
break;
case IS_ARRAY:
@ -780,13 +780,13 @@ PHP_FUNCTION(count)
/* If There's no handler and it doesn't implement Countable then add a warning */
/* Intentionally not converted to an exception */
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array));
RETURN_LONG(1);
break;
}
default:
/* Intentionally not converted to an exception */
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array));
RETURN_LONG(1);
break;
}
@ -4637,7 +4637,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
}
if (argc < req_args) {
zend_argument_count_error("At least %d parameters are required, %d given", req_args, argc);
zend_argument_count_error("At least %d arguments are required, %d given", req_args, argc);
RETURN_THROWS();
}
@ -4731,7 +4731,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
if (ZEND_NUM_ARGS() < req_args) {
zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS());
RETURN_THROWS();
}
@ -4783,7 +4783,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
if (ZEND_NUM_ARGS() < req_args) {
zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS());
RETURN_THROWS();
}
@ -5024,7 +5024,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
argc = ZEND_NUM_ARGS();
if (data_compare_type == DIFF_COMP_DATA_USER) {
if (argc < 3) {
zend_argument_count_error("At least 3 parameters are required, %d given", ZEND_NUM_ARGS());
zend_argument_count_error("At least 3 arguments are required, %d given", ZEND_NUM_ARGS());
RETURN_THROWS();
}
if (zend_parse_parameters(ZEND_NUM_ARGS(), "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
@ -5033,7 +5033,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
diff_data_compare_func = zval_user_compare;
} else {
if (argc < 2) {
zend_argument_count_error("At least 2 parameters are required, %d given", ZEND_NUM_ARGS());
zend_argument_count_error("At least 2 arguments are required, %d given", ZEND_NUM_ARGS());
RETURN_THROWS();
}
if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
@ -5130,7 +5130,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
}
if (ZEND_NUM_ARGS() < req_args) {
zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS());
RETURN_THROWS();
}
@ -5182,7 +5182,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
}
if (ZEND_NUM_ARGS() < req_args) {
zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS());
RETURN_THROWS();
}
@ -5378,7 +5378,7 @@ PHP_FUNCTION(array_diff)
zval dummy;
if (ZEND_NUM_ARGS() < 2) {
zend_argument_count_error("At least 2 parameters are required, %d given", ZEND_NUM_ARGS());
zend_argument_count_error("At least 2 arguments are required, %d given", ZEND_NUM_ARGS());
RETURN_THROWS();
}

View file

@ -63,11 +63,11 @@ function krsort(array &$array, int $sort_flags = SORT_REGULAR): bool {}
function ksort(array &$array, int $sort_flags = SORT_REGULAR): bool {}
/** @param array|Countable|null $var */
/** @param Countable|array $var */
function count($var, int $mode = COUNT_NORMAL): int {}
/**
* @param array|object|null $var
* @param Countable|array $var
* @alias count
*/
function sizeof($var, int $mode = COUNT_NORMAL): int {}

Some files were not shown because too many files have changed in this diff Show more