回答編集履歴

3

修正

2019/08/26 07:30

投稿

m.ts10806
m.ts10806

スコア80852

test CHANGED
@@ -32,7 +32,55 @@
32
32
 
33
33
  }
34
34
 
35
+ $f = new fuga();
36
+
37
+ $f->f();
38
+
39
+ $f->hoge();
40
+
35
41
  // PHP Fatal error: Class fuga contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::hoge)
42
+
43
+ ```
44
+
45
+ 正しくは
46
+
47
+ ```php
48
+
49
+ <?php
50
+
51
+ interface test {
52
+
53
+
54
+
55
+ function hoge();
56
+
57
+ }
58
+
59
+
60
+
61
+ class fuga implements test{
62
+
63
+ function f(){
64
+
65
+ echo 1;
66
+
67
+ }
68
+
69
+ function hoge(){ //実装必須メソッド
70
+
71
+ echo 2;
72
+
73
+ }
74
+
75
+ }
76
+
77
+ $f = new fuga();
78
+
79
+ $f->f();
80
+
81
+ $f->hoge();
82
+
83
+
36
84
 
37
85
  ```
38
86
 

2

修正

2019/08/26 07:30

投稿

m.ts10806
m.ts10806

スコア80852

test CHANGED
@@ -38,6 +38,6 @@
38
38
 
39
39
 
40
40
 
41
- エラーが画面に出てこないのは、おそらくfatalエラーは出ないようになっているのかなと。
41
+ エラーが画面に出てこないのは、おそらくサーバー側(またはphp内で)設定によってfatalエラーは出ないようになっているのかなと。
42
42
 
43
43
  エラー出力レベルをE_ALLにしてみては如何でしょうか。

1

修正

2019/08/26 07:29

投稿

m.ts10806
m.ts10806

スコア80852

test CHANGED
@@ -35,3 +35,9 @@
35
35
  // PHP Fatal error: Class fuga contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::hoge)
36
36
 
37
37
  ```
38
+
39
+
40
+
41
+ エラーが画面に出てこないのは、おそらくfatalエラーは出ないようになっているのかなと。
42
+
43
+ エラー出力レベルをE_ALLにしてみては如何でしょうか。