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

來源:互聯網
上載者:User

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("/{([^\}\{\n]*)}/e", "\$this->sel ect('\\1');", $source);
   替換為
   return preg_replace_callback  ("/{([^\}\{\n]*)}/", 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沒有輸出值

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.