File tree Expand file tree Collapse file tree 4 files changed +337
-308
lines changed
Expand file tree Collapse file tree 4 files changed +337
-308
lines changed Original file line number Diff line number Diff line change 2121 <link linkend =" language.oop.lsp" >signature compatibility</link > rules.
2222 </para >
2323
24- <para >
24+ <simpara >
2525 As of PHP 8.4, an abstract class may declare an abstract property, either public or protected.
2626 A protected abstract property may be satisfied by a property that is readable/writeable from either
2727 protected or public scope.
28- </para >
29- <para >
28+ </simpara >
29+ <simpara >
3030 An abstract property may be satisfied either by a standard property or by a property
3131 with defined <link linkend =" language.oop5.property-hooks" >hooks</link >, corresponding to the required operation.
32- </para >
32+ </simpara >
3333
3434 <example >
3535 <title >Abstract method example</title >
36- <programlisting role =" php" >
36+ <programlisting role =" php" >
3737<![CDATA[
3838<?php
3939abstract class AbstractClass
@@ -171,10 +171,10 @@ class C extends A
171171]]>
172172 </programlisting >
173173 </example >
174- <para >
174+ <simpara >
175175 An abstract property on an abstract class may provide implementations for any hook,
176176 but must have either <literal >get</literal > or <literal >set</literal > declared but not defined (as in the example above).
177- </para >
177+ </simpara >
178178 <example >
179179 <title >Abstract property example</title >
180180 <programlisting role =" php" >
Original file line number Diff line number Diff line change 9191 </sect2 >
9292 <sect2 xml : id =" language.oop5.interfaces.properties" >
9393 <title >Properties</title >
94- <para >
95- As of PHP 8.4.0, interfaces may also declare properties. If they do, the declaration must specify if the
96- property is to be readable, writeable, or both. The interface declaration applies only to public read
97- and write access.
98- </para >
99- <para >
100- An class may satisfy an interface property in multiple ways. It may define a public property. It may
101- define a public <link linkend =" language.oop5.property-hooks.virtual" >virtual property</link > that implements
102- only the corresponding hook. Or a read property may be satisfied by a <literal >readonly</literal > property.
94+ <simpara >
95+ As of PHP 8.4.0, interfaces may also declare properties.
96+ If they do, the declaration must specify if the property is to be readable,
97+ writeable, or both.
98+ The interface declaration applies only to public read and write access.
99+ </simpara >
100+ <simpara >
101+ An class may satisfy an interface property in multiple ways.
102+ It may define a public property.
103+ It may define a public
104+ <link linkend =" language.oop5.property-hooks.virtual" >virtual property</link >
105+ that implements only the corresponding hook.
106+ Or a read property may be satisfied by a <literal >readonly</literal > property.
103107 However, an interface property that is settable may not be <literal >readonly</literal >.
104- </para >
108+ </simpara >
105109 <example >
106110 <title >Interface properties example</title >
107111 <programlisting role =" php" >
You can’t perform that action at this time.
0 commit comments