Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 17_oop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -72,5 +72,5 @@ public function getTitle() {
}
}

$employee1 = new employee('John','johndoe@gmail.com','123456','Manager');
echo $employee1->getTitle();
$employee1 = new Employee('John','johndoe@gmail.com','123456','Manager');
echo $employee1->getTitle();