From ffc8c1b091b8f189439e4b9242449328116df382 Mon Sep 17 00:00:00 2001 From: Tomas Luque Gonzalez Date: Wed, 21 Nov 2018 22:50:18 +0100 Subject: [PATCH] Keywords explanation (#22407) * Keywords explanation * format better... add more info title + move link to it make a list of info under note --- guide/english/php/class/index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guide/english/php/class/index.md b/guide/english/php/class/index.md index 8b4ed6377f5..8e1c96a25e6 100644 --- a/guide/english/php/class/index.md +++ b/guide/english/php/class/index.md @@ -27,3 +27,13 @@ $lab = new Lab(); // keyword new creates instance of Lab class, variable $lab po $lab->setName($breaking_bad); // $lab variable that points to Lab instance calls setter function setName with $breaking_bad as parameter echo "My Name is " . $lab->say_my_name(). "!"; ``` + + +**Note**: +The keywords *private* and *public* define the visibility of the property or the method. + +- Class members declared public can be accessed everywhere. +- Members declared as private may only be accessed by the class that defines the member. + +### More Information +[visibility documentation](http://php.net/manual/en/language.oop5.visibility.php)