blob: a45cfbbfc3a7d1fb7f9207856fe755d7b02de25d (
plain)
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
|
<?php
class WellProtectedParentClass {
private $privateParentProperty;
public function __construct() {
$this->privateParentProperty = 9000;
}
private function incrementPrivateParentPropertyValue() {
$this->privateParentProperty++;
}
public function getPrivateParentProperty() {
return $this->privateParentProperty;
}
}
class WellProtectedClass extends WellProtectedParentClass {
protected $property;
private $privateProperty;
public function __construct() {
parent::__construct();
$this->property = 1;
$this->privateProperty = 42;
}
protected function incrementPropertyValue() {
$this->property++;
}
private function incrementPrivatePropertyValue() {
$this->privateProperty++;
}
public function getProperty() {
return $this->property;
}
public function getPrivateProperty() {
return $this->privateProperty;
}
protected function whatSecondArg( $a, $b = false ) {
return $b;
}
}
|