Skip to content

Commit a501009

Browse files
Tool comparison; interface is a macro on windows???
1 parent 9934843 commit a501009

3 files changed

Lines changed: 35 additions & 10 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
#[\Deprecated]: Interface deprecation RFC example
3+
--FILE--
4+
<?php
5+
6+
#[\Deprecated]
7+
interface BaseInterface {}
8+
9+
interface ChildInterface extends BaseInterface {}
10+
11+
class ImplementsBase implements BaseInterface {}
12+
13+
class ImplementsBoth implements BaseInterface, ChildInterface {}
14+
15+
class ImplementsChild implements ChildInterface {}
16+
17+
class ExtendsBaseImplementor extends ImplementsBase {}
18+
19+
?>
20+
--EXPECTF--
21+
Deprecated: Interface BaseInterface extended by ChildInterface is deprecated in %s on line %d
22+
23+
Deprecated: Interface BaseInterface implemented by ImplementsBase is deprecated in %s on line %d
24+
25+
Deprecated: Interface BaseInterface implemented by ImplementsBoth is deprecated in %s on line %d

Zend/zend_execute.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,20 +2033,20 @@ ZEND_API ZEND_COLD void zend_use_of_deprecated_trait(
20332033
}
20342034

20352035
static ZEND_COLD void zend_deprecated_interface_action(
2036-
zend_class_entry *interface,
2036+
zend_class_entry *iface,
20372037
const zend_string *by,
20382038
const char *action
20392039
) {
20402040
zend_string *message_suffix = ZSTR_EMPTY_ALLOC();
20412041

2042-
if (get_deprecation_suffix_from_attribute(interface->attributes, interface, &message_suffix) == FAILURE) {
2042+
if (get_deprecation_suffix_from_attribute(iface->attributes, iface, &message_suffix) == FAILURE) {
20432043
return;
20442044
}
20452045

2046-
int code = interface->type == ZEND_INTERNAL_CLASS ? E_DEPRECATED : E_USER_DEPRECATED;
2046+
int code = iface->type == ZEND_INTERNAL_CLASS ? E_DEPRECATED : E_USER_DEPRECATED;
20472047

20482048
zend_error_unchecked(code, "Interface %s %s by %s is deprecated%S",
2049-
ZSTR_VAL(interface->name),
2049+
ZSTR_VAL(iface->name),
20502050
action,
20512051
ZSTR_VAL(by),
20522052
message_suffix
@@ -2056,17 +2056,17 @@ static ZEND_COLD void zend_deprecated_interface_action(
20562056
}
20572057

20582058
ZEND_API ZEND_COLD void zend_implementation_of_deprecated_interface(
2059-
zend_class_entry *interface,
2059+
zend_class_entry *iface,
20602060
const zend_string *implemented_by
20612061
) {
2062-
zend_deprecated_interface_action(interface, implemented_by, "implemented");
2062+
zend_deprecated_interface_action(iface, implemented_by, "implemented");
20632063
}
20642064

20652065
ZEND_API ZEND_COLD void zend_extending_deprecated_interface(
2066-
zend_class_entry *interface,
2066+
zend_class_entry *iface,
20672067
const zend_string *extended_by
20682068
) {
2069-
zend_deprecated_interface_action(interface, extended_by, "extended");
2069+
zend_deprecated_interface_action(iface, extended_by, "extended");
20702070
}
20712071

20722072
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void)

Zend/zend_execute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_nodiscard_function(const zend_functio
6666
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_class_constant(const zend_class_constant *c, const zend_string *constant_name);
6767
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_constant(const zend_constant *c, const zend_string *constant_name);
6868
ZEND_API ZEND_COLD void zend_use_of_deprecated_trait(zend_class_entry *trait, const zend_string *used_by);
69-
ZEND_API ZEND_COLD void zend_implementation_of_deprecated_interface(zend_class_entry *interface, const zend_string *implemented_by);
70-
ZEND_API ZEND_COLD void zend_extending_deprecated_interface(zend_class_entry *interface, const zend_string *extended_by);
69+
ZEND_API ZEND_COLD void zend_implementation_of_deprecated_interface(zend_class_entry *iface, const zend_string *implemented_by);
70+
ZEND_API ZEND_COLD void zend_extending_deprecated_interface(zend_class_entry *iface, const zend_string *extended_by);
7171
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void);
7272
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
7373
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_use_resource_as_offset(const zval *dim);

0 commit comments

Comments
 (0)