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
Asymmetric Visibility and Final properties (#3828)
* Document asymmetric property visibility.
* Document the change in implicit visibility for readonly.
* Document final properties.
* Note that isPublic/Protected/Private is only in reference to the main visibility.
* Use more note tags.
* Remove unnecessary para tags.
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
<title>Final constants example as of PHP 8.1.0</title>
81
+
<programlistingrole="php">
66
82
<![CDATA[
67
83
<?php
68
84
class Foo
@@ -78,16 +94,17 @@ class Bar extends Foo
78
94
// Fatal error: Bar::X cannot override final constant Foo::X
79
95
?>
80
96
]]>
81
-
</programlisting>
82
-
</example>
83
-
</para>
97
+
</programlisting>
98
+
</example>
84
99
85
100
<note>
86
101
<simpara>
87
-
Properties cannot be declared final: only classes, methods, and constants (as of PHP 8.1.0) may be declared as final.
102
+
As of PHP 8.0.0, private methods may not be declared final except for the <linklinkend="language.oop5.decon.constructor">constructor</link>.
88
103
</simpara>
104
+
</note>
105
+
<note>
89
106
<simpara>
90
-
As of PHP 8.0.0, private methods may not be declared final except for the constructor.
107
+
A property that is declared <linklinkend="language.oop5.visibility-members-aviz"><literal>private(set)</literal></link> is implicitly <literal>final</literal>.
0 commit comments