Skip to content

Commit 49f60a8

Browse files
authored
Change and fix property visibility in lazy-objects example #3 (#4294)
With private visibility on id property for class BlogPost, example 3 is not functional. Changing visibility to public resolves this error. All properties are set to public in this example for homogeneity.
1 parent e93feee commit 49f60a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

language/oop5/lazy-objects.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ int(1)
141141
class BlogPost
142142
{
143143
public function __construct(
144-
private int $id,
145-
private string $title,
146-
private string $content,
144+
public int $id,
145+
public string $title,
146+
public string $content,
147147
) { }
148148
}
149149

0 commit comments

Comments
 (0)