public function getPassword() { } public function checkLogin() { } } // vi du 2 class B { private $__private; private function __func_private() { } } class C { private $__username; private $__password; public function setUserName($username) { $this->__username = $username; } public function getUserName() { return $this->__username; } } $c = new C(); $c->setUserName('Nguyen Dang Tung'); echo $c->getUserName();