diff --git a/17_oop.php b/17_oop.php index bfd5295..768fd49 100644 --- a/17_oop.php +++ b/17_oop.php @@ -61,8 +61,8 @@ function __destruct() { It is achieved by creating a new class that extends an existing class. */ -class employee extends User { - public function __construct($name, $email, $password, $title) { +class Employee extends User { + public function __construct($name, $email, $password, private $title) { parent::__construct($name, $email, $password); $this->title = $title; } @@ -72,5 +72,5 @@ public function getTitle() { } } -$employee1 = new employee('John','johndoe@gmail.com','123456','Manager'); -echo $employee1->getTitle(); \ No newline at end of file +$employee1 = new Employee('John','johndoe@gmail.com','123456','Manager'); +echo $employee1->getTitle();