【发布时间】:2018-04-04 01:30:27
【问题描述】:
遇到致命错误,我不知所措。
此代码在 PHP 5.2 上工作,但在 PHP 7 上失败。完全披露:我对 PHP 知之甚少。
注意:“CHtmlUsersListInt”位于我无法打开的加密文件中。加密文件是打开的,因为站点的其他部分依赖它工作正常,这似乎是我迁移到新服务器的最后一个问题。
include("./_include/core/main_start.php");
/*
Encrypted file that is opened and used in other parts of the site.
"CHtmlUsersListInt" lives here.
*/
class CHtmlUsersListAction extends CHtmlUsersListInt
{
function CHtmlUsersListAction($name, $html_path)
{
$this->CHtmlUsersListInt($name, $html_path); /* LINE THROWING ERROR */
}
}
$type = get_param("display", "list");
if ($type == "list") $list = new CHtmlUsersListAction("users_list", $g['tmpl']['dir_tmpl_main'] . "_mail_interest.html");
else
{
redirect("mail.php");
}
抛出错误的行:
$this->CHtmlUsersListInt($name, $html_path);
错误:
致命错误:调用未定义的方法 CHtmlUsersListAction::CHtmlUsersListInt()
【问题讨论】:
-
将这个示例的大小减小到演示您的问题所必需的最小值对您很有帮助。见:How to create a Minimal, Complete, and Verifiable example
-
除非
CHtmlUsersListAction类被更改,否则这是不可能的。
标签: php