Skip to content

Commit 840e441

Browse files
committed
Fix parameter name in call_user_func() error message
This parameter name has been changed to $callback.
1 parent 3244e07 commit 840e441

File tree

14 files changed

+23
-23
lines changed

14 files changed

+23
-23
lines changed

Zend/tests/bug45186.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ string(1) "y"
5454
ok
5555
__callstatic:
5656
string(3) "www"
57-
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access "self" when no class scope is active
57+
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active

Zend/tests/bug45186_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ string(1) "y"
5252
__call:
5353
string(1) "y"
5454
ok
55-
call_user_func(): Argument #1 ($function) must be a valid callback, class bar does not have a method "www"
56-
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access "self" when no class scope is active
55+
call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www"
56+
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active

Zend/tests/bug48770_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ $c->func('This should work!');
5656
--EXPECT--
5757
string(27) "B::func2: This should work!"
5858
string(27) "B::func3: This should work!"
59-
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method B::func22()
60-
call_user_func_array(): Argument #1 ($function) must be a valid callback, class B does not have a method "inexistent"
59+
call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
60+
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent"

Zend/tests/bug48770_3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ $c->func('This should work!');
4747
--EXPECT--
4848
string(27) "B::func2: This should work!"
4949
string(27) "B::func3: This should work!"
50-
call_user_func_array(): Argument #1 ($function) must be a valid callback, class C does not have a method "inexistent"
50+
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"

Zend/tests/call_user_func_002.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ try {
3131
?>
3232
--EXPECTF--
3333
string(3) "foo"
34-
call_user_func(): Argument #1 ($function) must be a valid callback, class "foo" not found
35-
call_user_func(): Argument #1 ($function) must be a valid callback, class "" not found
34+
call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
35+
call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
3636

3737
Warning: Undefined variable $foo in %s on line %d
38-
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
38+
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
3939

4040
Warning: Undefined variable $foo in %s on line %d
41-
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
41+
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

Zend/tests/methods-on-non-objects-call-user-func.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ try {
1010
}
1111
?>
1212
--EXPECT--
13-
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
13+
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

Zend/tests/nullsafe_operator/013.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool(false)
4747
bool(false)
4848
string(1) "%s"
4949
int(0)
50-
string(98) "call_user_func_array(): Argument #1 ($function) must be a valid callback, no array or string given"
50+
string(98) "call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given"
5151
string(77) "call_user_func_array(): Argument #2 ($args) must be of type array, null given"
5252
string(69) "get_class(): Argument #1 ($object) must be of type object, null given"
5353
string(55) "get_called_class() expects exactly 0 arguments, 1 given"

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3787,7 +3787,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM)
37873787
init_func_run_time_cache(&func->op_array);
37883788
}
37893789
} else {
3790-
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
3790+
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
37913791
efree(error);
37923792
FREE_OP2();
37933793
HANDLE_EXCEPTION();

Zend/zend_vm_execute.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6720,7 +6720,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
67206720
init_func_run_time_cache(&func->op_array);
67216721
}
67226722
} else {
6723-
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
6723+
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
67246724
efree(error);
67256725

67266726
HANDLE_EXCEPTION();
@@ -9011,7 +9011,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
90119011
init_func_run_time_cache(&func->op_array);
90129012
}
90139013
} else {
9014-
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
9014+
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
90159015
efree(error);
90169016
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
90179017
HANDLE_EXCEPTION();
@@ -11393,7 +11393,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
1139311393
init_func_run_time_cache(&func->op_array);
1139411394
}
1139511395
} else {
11396-
zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
11396+
zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
1139711397
efree(error);
1139811398

1139911399
HANDLE_EXCEPTION();

ext/standard/tests/general_functions/callbacks_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ O
106106
$this|O::who
107107
O
108108
$this|B::who
109-
call_user_func(): Argument #1 ($function) must be a valid callback, class P is not a subclass of B
109+
call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B

ext/standard/tests/general_functions/callbacks_002.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ try {
2121

2222
?>
2323
--EXPECT--
24-
call_user_func(): Argument #1 ($function) must be a valid callback, class "Foo" not found
25-
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
26-
call_user_func(): Argument #1 ($function) must be a valid callback, second array member is not a valid method
24+
call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found
25+
call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
26+
call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method

tests/classes/abstract_user_call.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ try {
2929
?>
3030
--EXPECT--
3131
test::func()
32-
call_user_func(): Argument #1 ($function) must be a valid callback, cannot call abstract method test_base::func()
32+
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot call abstract method test_base::func()

tests/classes/autoload_012.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414
?>
1515
--EXPECT--
1616
In autoload: string(6) "UndefC"
17-
call_user_func(): Argument #1 ($function) must be a valid callback, class "UndefC" not found
17+
call_user_func(): Argument #1 ($callback) must be a valid callback, class "UndefC" not found

tests/classes/bug27504.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ try {
2727
?>
2828
--EXPECT--
2929
Called function foo:bar(1)
30-
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method foo::bar()
30+
call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method foo::bar()
3131
Call to private method foo::bar() from global scope

0 commit comments

Comments
 (0)