From 49f60a82ba4639028981933193ebfa1afa644271 Mon Sep 17 00:00:00 2001 From: Paz Date: Wed, 11 Dec 2024 15:08:45 +0100 Subject: [PATCH] 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. --- language/oop5/lazy-objects.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/language/oop5/lazy-objects.xml b/language/oop5/lazy-objects.xml index 1a22d4df5801..a32b2978eed5 100644 --- a/language/oop5/lazy-objects.xml +++ b/language/oop5/lazy-objects.xml @@ -141,9 +141,9 @@ int(1) class BlogPost { public function __construct( - private int $id, - private string $title, - private string $content, + public int $id, + public string $title, + public string $content, ) { } }