@@ -772,7 +772,6 @@ A function or method may be referenced in a way that creates a closure out of it
772
772
773
773
If so, the ` ... ` MUST NOT include any whitespace before or after. That is, the correct format is ` foo(...) ` .
774
774
775
-
776
775
### 4.9 Property Hooks
777
776
778
777
Object properties may also include hooks, which have a number of syntactic options.
@@ -897,10 +896,27 @@ class Example
897
896
}
898
897
```
899
898
900
- ## 4.10 Interface properties
899
+ ## 4.10 Interface and abstract properties
901
900
902
901
Abstract properties may be defined in interfaces or abstract classes, but are required to
903
- specify if they must support ` get ` operations, ` set ` operations, or both.
902
+ specify if they must support ` get ` operations, ` set ` operations, or both. In the case
903
+ of abstract classes, they MAY include a body for one or another hook.
904
+
905
+ If there is a body for any hook, then the entire hook block MUST follow
906
+ the same rules as for defined hooks above. The only difference is that
907
+ a hook that has no body specified have a single semicolon after the hook
908
+ keyword, with no space before it.
909
+
910
+ ``` php
911
+ abstract class Example {
912
+ abstract public string $name {
913
+ get => ucfirst($this->name);
914
+ set;
915
+ }
916
+ }
917
+ ```
918
+
919
+ If there is no body for either hook, then the following rules apply:
904
920
905
921
* The operation block MUST be on the same line as the property.
906
922
* There MUST be a single space between the property name and the operation block ` {} ` .
0 commit comments