-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop8.php
More file actions
51 lines (36 loc) · 1.13 KB
/
oop8.php
File metadata and controls
51 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
class User {
public $name;
public $password;
public $email;
public $city;
function __construct($name, $password, $email, $city) {
$this->name = $name;
$this->password = $password;
$this->email = $email;
$this->city = $city;
}
function getInfo() {
$information = "{$this->name}" . "{$this->password}" . "{$this->email}" . "{$this->city}";
return $information;
}
}
$admin = new User(" Umman", " 123456", " umman152@mail.ru", " Baku");
//echo $admin->getInfo();
//echo '<br>';
class Moderator extends User {
public $info;
public $rights;
function __construct($name, $password, $email, $city, $info, $rights) {
parent::__construct($name, $password, $email, $city);
$this->info = $info;
$this->rights = $rights;
}
function getInfo() {
$information = parent::getInfo();
$information .= "{$this->info}" . "{$this->rights}";
return $information;
}
}
$moder = new Moderator(" Huseyn", " 234567", " huseyin.hasanov.2014@gmail.com", " Masalli", " Moderator", " True");
echo $moder->getInfo();