File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -579,13 +579,19 @@ public function process(string $algorithm, &...$parts)
579
579
}
580
580
```
581
581
582
- ### 4.6 ` abstract ` , ` final ` , and ` static `
582
+ ### 4.6 Modifier keywords
583
583
584
- When present, the ` abstract ` and ` final ` declarations MUST precede the
585
- visibility declaration.
584
+ Properties and methods of a class have numerous keyword modifiers that alter how the
585
+ engine and language handles them. When present, they MUST be in the following order:
586
586
587
- When present, the ` static ` declaration MUST come after the visibility
588
- declaration.
587
+ * Inheritance modifier: ` abstract ` or ` final `
588
+ * Visibility modifier: ` public ` , ` protected ` , or ` private `
589
+ * Scope modifier: ` static `
590
+ * Mutation modifier: ` readonly `
591
+ * Type declaration
592
+ * Name
593
+
594
+ All keywords MUST be on a single line, and MUST be separated by a single space.
589
595
590
596
``` php
591
597
<?php
@@ -594,7 +600,9 @@ namespace Vendor\Package;
594
600
595
601
abstract class ClassName
596
602
{
597
- protected static $foo;
603
+ protected static readonly string $foo;
604
+
605
+ final protected int $beep;
598
606
599
607
abstract protected function zim();
600
608
You can’t perform that action at this time.
0 commit comments