-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc13.php
57 lines (42 loc) · 889 Bytes
/
c13.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
54
55
56
57
<?php
class Roditel {
protected $parent_name='Risto';
protected $parent_age = 50;
}
class Child extends Roditel {
protected $child_name = 'Mimi';
protected $child_age = 22;
public function setChildName($name){
$this->child_name = $name;
}
public function setChildAge($age){
$this->child_age = $age;
}
public function setParentName($namep){
$this->parent_name = $namep;
}
public function setParentAge($agep){
$this->parent_age = $agep;
}
public function getChildName(){
return $this->child_name;
}
public function getChildAge(){
return $this->child_age;
}
public function getParentName(){
return $this->parent_name;
}
public function getParentAge(){
return $this->parent_age;
}
}
class Vnuche extends Child {
private $vnuche_name;
private $vnuche_age;
}
$m1= new Child();
$m1->setParentAge(55);
// $m1->getParentAge();
print_r($m1);
?>