【发布时间】:2017-03-20 07:39:29
【问题描述】:
你好,我有问题,
用我的代码,我不知道我修复这个代码是什么
错误
致命错误:类组包含 1 个抽象方法,因此必须在第 16 行的 D:\xampp\htdocs\tes\index.php 中声明为抽象方法或实现其余方法 (Aturan::cari)
这是我的代码
<?php
interface Aturan {
public function cari($id);
}
trait Bantuan {
public function ubah_ke_string_json($str){
return NULL;
}
}
abstract class Aturan_abstrak implements Aturan {
use Bantuan;
}
class Group extends Aturan_abstrak {
protected $grup;
public function Group($grup) {
$this->grup = $grup;
}
}
$grup = new Group(array(
"C" => array("administrator"),
"A" => array("operator","staff")
));
echo $grup->cari("A");
?>
我很困惑,请帮帮我。
【问题讨论】: