Skip to content

Commit 9270e48

Browse files
committed
Use actual class/method names in error message
1 parent 901074c commit 9270e48

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed

Zend/tests/bug48770.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ $c->callFuncInParent('Which function will be called??');
3131

3232
?>
3333
--EXPECTF--
34-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
34+
Deprecated: Callables of the form ["C", "parent::func"] are deprecated in %s on line %d
3535
B::func called

Zend/tests/bug48770_2.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ $c->func('This should work!');
5454

5555
?>
5656
--EXPECTF--
57-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
57+
Deprecated: Callables of the form ["C", "parent::func2"] are deprecated in %s on line %d
5858
string(27) "B::func2: This should work!"
5959

60-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
60+
Deprecated: Callables of the form ["C", "parent::func3"] are deprecated in %s on line %d
6161
string(27) "B::func3: This should work!"
6262

63-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
63+
Deprecated: Callables of the form ["C", "parent::func22"] are deprecated in %s on line %d
6464
call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22()
6565

66-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
66+
Deprecated: Callables of the form ["C", "parent::inexistent"] are deprecated in %s on line %d
6767
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ $c->func('This should work!');
4545

4646
?>
4747
--EXPECTF--
48-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
48+
Deprecated: Callables of the form ["C", "self::func2"] are deprecated in %s on line %d
4949
string(27) "B::func2: This should work!"
5050

51-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
51+
Deprecated: Callables of the form ["C", "self::func3"] are deprecated in %s on line %d
5252
string(27) "B::func3: This should work!"
5353

54-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
54+
Deprecated: Callables of the form ["C", "self::inexistent"] are deprecated in %s on line %d
5555
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent"

Zend/tests/bug66719.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ C::test();
3838
string(1) "B"
3939
string(1) "A"
4040

41-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
41+
Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d
4242
string(1) "A"
4343
string(1) "B"
4444
string(1) "A"
4545

46-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
46+
Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d
4747
string(1) "A"

Zend/tests/callable_self_parent_static_deprecation.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ Deprecated: Use of "parent" in callables is deprecated in %s on line %d
5454

5555
Deprecated: Use of "static" in callables is deprecated in %s on line %d
5656

57-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
57+
Deprecated: Callables of the form ["B", "self::foo"] are deprecated in %s on line %d
5858

59-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
59+
Deprecated: Callables of the form ["B", "parent::foo"] are deprecated in %s on line %d
6060

61-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
61+
Deprecated: Callables of the form ["B", "static::foo"] are deprecated in %s on line %d
6262

63-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
63+
Deprecated: Callables of the form ["B", "A::foo"] are deprecated in %s on line %d
6464
Test array_map()
6565

6666
Deprecated: Use of "self" in callables is deprecated in %s on line %d

Zend/zend_API.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3494,7 +3494,8 @@ static zend_always_inline bool zend_is_callable_check_func(int check_flags, zval
34943494
}
34953495
if (ce_org && error) {
34963496
zend_error(E_DEPRECATED,
3497-
"Callables of the form [\"C1\", \"C2::method\"] are deprecated");
3497+
"Callables of the form [\"%s\", \"%s\"] are deprecated",
3498+
ZSTR_VAL(ce_org->name), Z_STRVAL_P(callable));
34983499
}
34993500
mname = zend_string_init(Z_STRVAL_P(callable) + clen + 2, mlen, 0);
35003501
} else if (ce_org) {

ext/standard/tests/general_functions/bug40398.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ new Derived_6('6');
7474

7575
?>
7676
--EXPECTF--
77-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
77+
Deprecated: Callables of the form ["Derived_1", "Base::__construct"] are deprecated in %s on line %d
7878
Base::__construct(1)
7979

80-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
80+
Deprecated: Callables of the form ["Derived_2", "parent::__construct"] are deprecated in %s on line %d
8181
Base::__construct(2)
8282
Base::__construct(3)
8383

ext/standard/tests/general_functions/callbacks_001.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ Deprecated: Use of "parent" in callables is deprecated in %s on line %d
9090
B
9191
C|parent::who
9292

93-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
93+
Deprecated: Callables of the form ["C", "parent::who"] are deprecated in %s on line %d
9494
B
9595
B|parent::who
9696

97-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
97+
Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d
9898
A
9999
E|parent::who
100100

101-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
101+
Deprecated: Callables of the form ["E", "parent::who"] are deprecated in %s on line %d
102102
D
103103
A|who
104104
A
@@ -113,11 +113,11 @@ Deprecated: Use of "parent" in callables is deprecated in %s on line %d
113113
O
114114
P|parent::who
115115

116-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
116+
Deprecated: Callables of the form ["P", "parent::who"] are deprecated in %s on line %d
117117
O
118118
$this|O::who
119119

120-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
120+
Deprecated: Callables of the form ["P", "O::who"] are deprecated in %s on line %d
121121
O
122122
$this|B::who
123123
call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B

tests/classes/abstract_user_call.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ try {
3030
--EXPECTF--
3131
test::func()
3232

33-
Deprecated: Callables of the form ["C1", "C2::method"] are deprecated in %s on line %d
33+
Deprecated: Callables of the form ["test", "test_base::func"] are deprecated in %s on line %d
3434
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot call abstract method test_base::func()

0 commit comments

Comments
 (0)