Person Class

class Person {
    public $name;
    protected $spouse;
    private $password;
 
    public function __construct($name) {
        $this->name = $name
    }    public function getName() {
        return $name;
    }    protected function setSpouse(Person $spouse) {
        if (!isset($this->spouse)) {
            $this->spouse = $spouse;
        }
    }    private function setPassword($password) {
        $this->password = $password;
    }
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.