回答編集履歴
2
調整
test
CHANGED
@@ -1,3 +1,59 @@
|
|
1
1
|
普通に期待値の通りになっていると思います
|
2
2
|
|
3
3
|
(気持ち悪いゲッタを使っていますが)
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
```PHP
|
8
|
+
|
9
|
+
class ParentClass{
|
10
|
+
|
11
|
+
const BASE_LIST = [
|
12
|
+
|
13
|
+
"KeyA" => "hogehoge",
|
14
|
+
|
15
|
+
"KeyB" => "hugahuga",
|
16
|
+
|
17
|
+
"KeyC" => "hungaaaa",
|
18
|
+
|
19
|
+
];
|
20
|
+
|
21
|
+
const OVERRIDE_LIST = [];
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
public function get_list()
|
26
|
+
|
27
|
+
{
|
28
|
+
|
29
|
+
$base = SELF::BASE_LIST;
|
30
|
+
|
31
|
+
$list = STATIC::OVERRIDE_LIST;
|
32
|
+
|
33
|
+
return array_merge($base, $list);
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
class ChildClass extends ParentClass
|
40
|
+
|
41
|
+
{
|
42
|
+
|
43
|
+
const OVERRIDE_LIST = [
|
44
|
+
|
45
|
+
"KeyA" => "piyopiyo",
|
46
|
+
|
47
|
+
"KeyB" => "puyopuyo",
|
48
|
+
|
49
|
+
];
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
$child = new ChildClass();
|
56
|
+
|
57
|
+
print_r($child->get_list());
|
58
|
+
|
59
|
+
```
|
1
ちょうせい
test
CHANGED
@@ -1 +1,3 @@
|
|
1
1
|
普通に期待値の通りになっていると思います
|
2
|
+
|
3
|
+
(気持ち悪いゲッタを使っていますが)
|