你好,我在 codeigniter 工作,我尝试消除我网站上的警告,我阻止:
$groups = array();
if ($bannished_groups) {
foreach ($bannished_groups as $k => $bannished_group) {
$groups[$k] = $this->group_model->GetGroupByID($bannished_group->groupid);
$groups[$k]->db = $bannished_group;
}
}
我有错误:
从空值创建默认对象
我试图声明:
$groups[$k]->db = new stdClass();
但它不起作用,我阅读了其他答案,但对我没有帮助..
犯罪嫌疑人X