-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisibility.php
More file actions
55 lines (38 loc) · 992 Bytes
/
Copy pathvisibility.php
File metadata and controls
55 lines (38 loc) · 992 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
50
51
52
53
54
55
<?php
class sampleClass{
public int $number = 10;
private $interest = 10;
protected $name = "XYZ";
public function __construct(){
#echo $this->number;
}
private function showResult(){
#echo $this->number;
echo $this->interest;
}
public function showNumber(){
#echo $this->number;
echo $this->showResult();
echo $this->newresult();
echo $this->name;
}
protected function newresult(){
#echo $this->number;
echo $this->showResult();
echo $this->name;
}
}
class extendedClass extends sampleClass{
public function childpro(){
echo $this->newresult();
}
}
$object1 = new sampleClass();
$object1->number;
#echo $object1->name;
$object1->showNumber();
$object1->newresult();
$object2 = new extendedClass();
$object2->showNumber();
$object2->childpro();
?>