File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,17 @@ print $p->fullName; // Prints "Peter Peterson"
62
62
<title >Asymmetric Property Visibility</title >
63
63
64
64
<simpara >
65
- Object properties may now have their <literal >set</literal > visibility controlled separately from the <literal >get</literal > visibility.
65
+ Object properties may now have their <literal >set</literal > visibility
66
+ controlled separately from the <literal >get</literal > visibility.
66
67
</simpara >
67
68
<informalexample >
68
69
<programlisting role =" php" >
69
70
<![CDATA[
70
71
<?php
71
72
class Example
72
73
{
74
+ // The first visibility modifier controls the get-visibility, and the second modifier
75
+ // controls the set-visibility. The get-visibility must not be narrower than set-visibility.
73
76
public protected(set) string $name;
74
77
75
78
public function __construct(string $name)
You can’t perform that action at this time.
0 commit comments