Consider below code please:
class foo { function bar() { $this->baz = \'hello there!\'; } } $f = new foo; $f->bar(); echo $f->baz; // h
By default it is set to public.
Refer to this link: http://www.php.net/manual/en/language.oop5.visibility.php