class Person { protected $email; public function setEmail($email) { $this->email = $email; } public function getEmail() { return $this->email; }}class Student extends Person { public function showEmail() { echo $this->email; }}$p1 = new Person();$p1->setEmail("alice@example.com");$s1 = new Student();$s1->setEmail("bob@example.com");echo $p1->getEmail(); // 输出:alice@example.comecho $s1->getEmail(); // 输出:bob@example.com$s1->showEmail(); // 输出:bob@example.com