class employee public surname public name public patronymic public fun

 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
class employee {
public $surname;
public $name;
public $patronymic;
public function get_age()
{
return $this->age;
}
public function set_age($val)
{
$val = intval($val);
if ($val >= 18 && $val <= 65)
{
$this->age = $val;
return true;
}
else return false;
}
public function get_info()
{
return $this->surname." ".$this->name." ".$this->patronymic;
}
public function get_full_info()
{
return $this->get_info()." (".$this->age.")";
}
private $age;
}