手机看片精品高清国产日韩,色先锋资源综合网,国产哺乳奶水91在线播放,乱伦小说亚洲色图欧洲电影

ecshop因php版本過高引起的7種報錯

2016-09-16 15:20:29 11670


ecshop因php版本過高引起的7報錯這個是因高版本的php已經不支持舊版本的一些方法與函數了,我們下面來看一篇關于ecshop因php版本過高引起錯誤的問題解決辦法。


ecshop兼容PHP版本較低,不兼容PHP更高的版本,如果使用其他版本可能會出現各種錯誤,如以下七種錯誤問題:



1、Strict Standards: Non-static method cls_image::gd_version() should not be called statically

   

未聲明靜態static將

return cls_image::gd_version();

替換為

$p = new cls_image();
return $p->gd_version();

2、Strict Standards: Only variables should be passed by reference


變量應該通過引用傳遞將

$tag_sel = array_shift(explode(' ', $tag));

替換為

$tag_arr = explode(' ', $tag);
$tag_sel = array_shift($tag_arr);


3、Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in


return preg_replace("/{([^}{
]*)}/e", "$this->sel ect('\1');", $source);

替換為

return preg_replace_callback  ("/{([^}{
]*)}/", function($r) { return $this->sel ect($r[1]); },    $source);

4、Strict Standards: Redefining already defined constructor for class paypal


PHP 類,有兩種構造函數,一種是跟類同名的函數,一種是 ____construct()。從PHP5.4開始,對這兩個函數出現的順序做了最嚴格的定義,必須是 ____construct() 在前,同名函數在后。

例如:

function __construct()
    {
        $this->paypal();
    }
   
    function paypal()
    {
    }

5、mktime(): You should be using the time() function instead


mktime()方法不帶參數被調用,將

$auth = mktime();

替換為

$auth = time();

6、Strict Standards: Declaration of vbb::set_cookie() should be compatible with integrate::set_cookie($username = '', $remember = NULL)


子類的函數跟父類的同名,必須使子類的函數參數跟父類的對應函數參數個數相同

依據錯誤提示,修改例如:

function set_cookie ($username="")

改為

function set_cookie ($username="", $remember = NULL)

7、Parse error: syntax error, unexpected ';'
語法錯誤,缺少;或者echo沒有輸出值


提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: