Skip to content

Commit 4caa0ab

Browse files
committed
Modified Keywords code sample contains parse errors
* The `static` and `readonly` modifiers for properties are, at the time of writing, mutually exclusive, which makes the first property example a parse error. * `final` properties are not a thing in PHP, which makes the second property example a parse error. This commit fixes both code examples. While I can appreciate that the code sample _intends_ to show an example where all possible modifier keywords + type declarations are used, I do not believe that showing this via code which isn't valid PHP to begin with, is helpful. Introduced in 19.
1 parent 396af44 commit 4caa0ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,9 @@ namespace Vendor\Package;
676676

677677
abstract class ClassName
678678
{
679-
protected static readonly string $foo;
679+
protected static string $foo;
680680

681-
final protected int $beep;
681+
private readonly int $beep;
682682

683683
abstract protected function zim();
684684

0 commit comments

Comments
 (0)