File tree Expand file tree Collapse file tree
language/predefined/attributes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88 <section xml : id =" returntypewillchange.intro" >
99 &reftitle.intro;
10- <para >
10+ <simpara >
1111 Most non-final internal methods now require overriding methods to declare
1212 a compatible return type, otherwise a deprecated notice is emitted during
13- inheritance validation.
13+ inheritance validation. This introduces a tentative return type phase:
14+ the engine emits a deprecation notice instead of a fatal error when return
15+ types are incompatible, before they become enforced in a future version.
1416 In case the return type cannot be declared for an overriding method due to
1517 PHP cross-version compatibility concerns,
1618 a <code >#[\ReturnTypeWillChange]</code > attribute can be added to silence
1719 the deprecation notice.
18- </para >
20+ </simpara >
21+
22+ <warning >
23+ <simpara >
24+ The <classname >ReturnTypeWillChange</classname > attribute suppresses
25+ deprecation warnings during the tentative return type phase <emphasis >only</emphasis >.
26+ It has no effect when overriding methods defined in user-defined classes.
27+ Once internal methods adopt strict types, mismatches in overriding method
28+ signatures will cause a fatal error and this attribute will no longer have any effect.
29+ </simpara >
30+ </warning >
31+
1932 </section >
2033
2134 <section xml : id =" returntypewillchange.synopsis" >
You can’t perform that action at this time.
0 commit comments