diff --git a/language/oop5/visibility.xml b/language/oop5/visibility.xml index 8ebf24f0a7..8e856cf452 100644 --- a/language/oop5/visibility.xml +++ b/language/oop5/visibility.xml @@ -1,5 +1,5 @@ - + Visibility @@ -98,23 +98,23 @@ $obj2->printHello(); // Shows Public, Protected2, not Private class MyClass { // Contructors must be public - public __construct() { } + public function __construct() { } // Declare a public method - public MyPublic() { } + public function MyPublic() { } // Declare a protected method - protected MyProtected() { } + protected function MyProtected() { } // Declare a private method - private MyPrivate() { } + private function MyPrivate() { } // This is public - Foo() + function Foo() { - $this->public(); - $this->protected(); - $this->private(); + $this->MyPublic(); + $this->MyProtected(); + $this->MyPrivate(); } } @@ -131,11 +131,11 @@ $myclass->Foo(); // Public, Protected and Private work class MyClass2 extends MyClass { // This is public - Foo2() + function Foo2() { - $this->public(); - $this->protected(); - $this->private(); + $this->MyPublic(); + $this->MyProtected(); + $this->MyPrivate(); // Fatal Error } }