error非静态方法sessions :: set_sessions

时间:2016-02-21 02:53:04

标签: php

我收到这些错误行:

[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 120
[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 122
[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 124
[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 126
[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 128
[29-Jan-2016 00:27:59 Africa/Cairo] PHP Strict Standards:  Non-static method sessions::set_sessions() should not be called statically in /home/trizipo/public_html/admin/controller/login.php on line 130

关于此代码: code pic 有解决方案吗?

1 个答案:

答案 0 :(得分:0)

set_sessions课程中的方法sessions不包含static keyword。如果您打算静态调用它,它应该如下所示:

class sessions
{
    ....

    public static function set_sessions($key, $value)
    {
        ...
    }

    ...
}