-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass_lib.php
More file actions
49 lines (43 loc) · 781 Bytes
/
class_lib.php
File metadata and controls
49 lines (43 loc) · 781 Bytes
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
<?php
class person
{
var $name;
public $height;
protected $social_insurance;
private $pinn_number;
function __construct($persons_name)
{
$this->name = $persons_name;
}
function get_pinn_number()
{
return $this->pinn_number;
}
protected function set_name($new_name)
{
$this->name= strtoupper($new_name);
}
function get_name()
{
return $this->name;
}
}
class employee extends person
{
function __construct($employee_name)
{
$this->set_name($employee_name);
}
protected function set_name($new_name)
{
if ($new_name == "Stefan Sucks")
{
$this->name = $new_name;
}
else if ($new_name == "Johnny Fingers")
{
parent::set_name($new_name);
}
}
}
?>