回答編集履歴
3
修正
answer
CHANGED
@@ -15,8 +15,32 @@
|
|
15
15
|
echo 1;
|
16
16
|
}
|
17
17
|
}
|
18
|
+
$f = new fuga();
|
19
|
+
$f->f();
|
20
|
+
$f->hoge();
|
18
21
|
// PHP Fatal error: Class fuga contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::hoge)
|
19
22
|
```
|
23
|
+
正しくは
|
24
|
+
```php
|
25
|
+
<?php
|
26
|
+
interface test {
|
27
|
+
|
28
|
+
function hoge();
|
29
|
+
}
|
20
30
|
|
31
|
+
class fuga implements test{
|
32
|
+
function f(){
|
33
|
+
echo 1;
|
34
|
+
}
|
35
|
+
function hoge(){ //実装必須メソッド
|
36
|
+
echo 2;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
$f = new fuga();
|
40
|
+
$f->f();
|
41
|
+
$f->hoge();
|
42
|
+
|
43
|
+
```
|
44
|
+
|
21
45
|
エラーが画面に出てこないのは、おそらくサーバー側(またはphp内で)設定によってfatalエラーは出ないようになっているのかなと。
|
22
46
|
エラー出力レベルをE_ALLにしてみては如何でしょうか。
|
2
修正
answer
CHANGED
@@ -18,5 +18,5 @@
|
|
18
18
|
// PHP Fatal error: Class fuga contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::hoge)
|
19
19
|
```
|
20
20
|
|
21
|
-
エラーが画面に出てこないのは、おそらくfatalエラーは出ないようになっているのかなと。
|
21
|
+
エラーが画面に出てこないのは、おそらくサーバー側(またはphp内で)設定によってfatalエラーは出ないようになっているのかなと。
|
22
22
|
エラー出力レベルをE_ALLにしてみては如何でしょうか。
|
1
修正
answer
CHANGED
@@ -16,4 +16,7 @@
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
// PHP Fatal error: Class fuga contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::hoge)
|
19
|
-
```
|
19
|
+
```
|
20
|
+
|
21
|
+
エラーが画面に出てこないのは、おそらくfatalエラーは出ないようになっているのかなと。
|
22
|
+
エラー出力レベルをE_ALLにしてみては如何でしょうか。
|