1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix parameter name in call_user_func() error message

This parameter name has been changed to $callback.
This commit is contained in:
Nikita Popov
2021-07-29 12:46:55 +02:00
parent 3244e0785d
commit 840e441d2d
14 changed files with 23 additions and 23 deletions

View File

@@ -54,4 +54,4 @@ string(1) "y"
ok
__callstatic:
string(3) "www"
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access "self" when no class scope is active
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active

View File

@@ -52,5 +52,5 @@ string(1) "y"
__call:
string(1) "y"
ok
call_user_func(): Argument #1 ($function) must be a valid callback, class bar does not have a method "www"
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access "self" when no class scope is active
call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active

View File

@@ -56,5 +56,5 @@ $c->func('This should work!');
--EXPECT--
string(27) "B::func2: This should work!"
string(27) "B::func3: This should work!"
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method B::func22()
call_user_func_array(): Argument #1 ($function) must be a valid callback, class B does not have a method "inexistent"
call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"

View File

@@ -47,4 +47,4 @@ $c->func('This should work!');
--EXPECT--
string(27) "B::func2: This should work!"
string(27) "B::func3: This should work!"
call_user_func_array(): Argument #1 ($function) must be a valid callback, class C does not have a method "inexistent"
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"

View File

@@ -31,11 +31,11 @@ try {
?>
--EXPECTF--
string(3) "foo"
call_user_func(): Argument #1 ($function) must be a valid callback, class "foo" not found
call_user_func(): Argument #1 ($function) must be a valid callback, class "" not found
call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
Warning: Undefined variable $foo in %s on line %d
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
Warning: Undefined variable $foo in %s on line %d
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

View File

@@ -10,4 +10,4 @@ try {
}
?>
--EXPECT--
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

View File

@@ -47,7 +47,7 @@ bool(false)
bool(false)
string(1) "%s"
int(0)
string(98) "call_user_func_array(): Argument #1 ($function) must be a valid callback, no array or string given"
string(98) "call_user_func_array(): Argument #1 ($callback) 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(55) "get_called_class() expects exactly 0 arguments, 1 given"

View File

@@ -3787,7 +3787,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM)
init_func_run_time_cache(&func->op_array);
}
} else {
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
FREE_OP2();
HANDLE_EXCEPTION();

View File

@@ -6720,7 +6720,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
init_func_run_time_cache(&func->op_array);
}
} else {
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
HANDLE_EXCEPTION();
@@ -9011,7 +9011,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
init_func_run_time_cache(&func->op_array);
}
} else {
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
HANDLE_EXCEPTION();
@@ -11393,7 +11393,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
init_func_run_time_cache(&func->op_array);
}
} else {
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
HANDLE_EXCEPTION();

View File

@@ -106,4 +106,4 @@ O
$this|O::who
O
$this|B::who
call_user_func(): Argument #1 ($function) must be a valid callback, class P is not a subclass of B
call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B

View File

@@ -21,6 +21,6 @@ try {
?>
--EXPECT--
call_user_func(): Argument #1 ($function) must be a valid callback, class "Foo" not found
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($function) must be a valid callback, second array member is not a valid method
call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method

View File

@@ -29,4 +29,4 @@ try {
?>
--EXPECT--
test::func()
call_user_func(): Argument #1 ($function) must be a valid callback, cannot call abstract method test_base::func()
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot call abstract method test_base::func()

View File

@@ -14,4 +14,4 @@ try {
?>
--EXPECT--
In autoload: string(6) "UndefC"
call_user_func(): Argument #1 ($function) must be a valid callback, class "UndefC" not found
call_user_func(): Argument #1 ($callback) must be a valid callback, class "UndefC" not found

View File

@@ -27,5 +27,5 @@ try {
?>
--EXPECT--
Called function foo:bar(1)
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method foo::bar()
call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method foo::bar()
Call to private method foo::bar() from global scope