-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
53 lines (48 loc) · 1010 Bytes
/
index.php
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
51
52
53
<?php
class Teacher {
// content
protected $name;
protected $spes;
protected $birth_date;
public function __construct(string $name, string $birth_date, string $spes) {
$this->name = $name;
$this->birth_date = $birth_date;
$this->spes = $spes;
}
//getter
public function getName()
{
return $this->name;
}
//setter
public function setName($name)
{
$this->name = $name;
}
//getter
public function getSpes()
{
return $this->spes;
}
//setter
public function setSpes($spes)
{
if(in_array($spes, ['IT', 'Math', 'Phisics'])){
$this->spes = $spes;
}
}
// function*
function sleep(): string
{
return 'shaxzod';
}
// procedure
function go()
{
// go home
}
}
$teacher = new Teacher('Shaxzodbek', '2003', 'IT');
$teacher->setSpes('History');
var_dump($teacher->getSpes());
var_dump(DB::getInstance());