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
Copy file name to clipboardExpand all lines: published/short-class.ptxt
+1-19Lines changed: 1 addition & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
===== Introduction =====
10
10
11
-
This RFC proposes a new short syntax for class/enum definitions in PHP and the ability to embed these classes within other classes.
11
+
This RFC proposes a new short syntax for class definitions in PHP and the ability to embed these classes within other classes.
12
12
13
13
===== Proposal =====
14
14
@@ -66,24 +66,6 @@ Attributes may also be used with short classes:
66
66
class Password(#[SensitiveParameter] string $password);
67
67
</code>
68
68
69
-
==== Short enums ====
70
-
71
-
Enums are a common pattern in PHP applications and are usually simple data structures that hold a set of constants. This RFC includes a proposal for short enums:
72
-
73
-
<code php>
74
-
enum Color(Red, Green, Blue);
75
-
</code>
76
-
77
-
This is equivalent to the following full enum definition:
78
-
79
-
<code php>
80
-
enum Color {
81
-
case Red;
82
-
case Green;
83
-
case Blue;
84
-
}
85
-
</code>
86
-
87
69
==== Inner Classes ====
88
70
89
71
Inner classes are classes that are defined within another class.
0 commit comments