You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This more accurately matches the "copy & paste" semantics described in
the documentation. Abstract trait methods diverge from this behavior,
given that a parent method can satisfy trait methods used in the child.
In that case, the method is not copied, but the check is performed after
the parent has been bound.
FixesGH-15753
Copy file name to clipboardExpand all lines: Zend/tests/traits/constant_015.phpt
+1-13Lines changed: 1 addition & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,6 @@ class DerivedClass1 extends BaseClass1 {
15
15
use TestTrait1;
16
16
}
17
17
18
-
trait TestTrait2 {
19
-
publicfinalconstConstant = 123;
20
-
}
21
-
22
-
class BaseClass2 {
23
-
publicfinalconstConstant = 456;
24
-
}
25
-
26
-
class DerivedClass2 extends BaseClass2 {
27
-
use TestTrait2;
28
-
}
29
-
30
18
?>
31
19
--EXPECTF--
32
-
Fatal error: BaseClass2 and TestTrait2 define the same constant (Constant) in the composition of DerivedClass2. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
20
+
Fatal error: DerivedClass1::Constant cannot override final constant BaseClass1::Constant in %s on line %d
0 commit comments