Strict Standards有關問題,幫忙看下

來源:互聯網
上載者:User
Strict Standards問題,幫忙看下
我用的是php5.4.剛安裝了scws分詞模組,但是運行時出現如下情況:
Strict Standards: Redefining already defined constructor for class PSCWS3 in D:\php\wamp\www\scws\pscws3.class.php on line 145

Strict Standards: Redefining already defined constructor for class PSCWS23_Dict in D:\php\wamp\www\scws\dict.class.php on line 48

Strict Standards: Redefining already defined constructor for class xdb_Dictionary in D:\php\wamp\www\scws\dict.class.php on line 148

Strict Standards: Redefining already defined constructor for class dba_Dictionary in D:\php\wamp\www\scws\dict.class.php on line 201

Strict Standards: Redefining already defined constructor for class sql_Dictionary in D:\php\wamp\www\scws\dict.class.php on line 257

Strict Standards: Redefining already defined constructor for class txt_Dictionary in D:\php\wamp\www\scws\dict.class.php on line 315

Strict Standards: Redefining already defined constructor for class XDB_R in D:\php\wamp\www\scws\xdb_r.class.php on line 34


php.ini中的錯誤報表error_reporting我也改了,我將error_reporting = E_ALL & ~E_NOTICE直接去掉了,還是沒用,請問這該怎麼解決。分詞功能都能實現,就是出現上面的錯誤報表。

分享到:


------解決方案--------------------
我將error_reporting = E_ALL & ~E_NOTICE直接去掉了,還是沒用
你這是什麼意思?
注釋掉 error_reporting,即不設定 error_reporting 時,php 將按預設的最嚴格的方式檢查錯誤

對於 Strict Standards 類型錯誤,php5.3 預設不檢查,而php5.4預設檢查
開發環境中一般應有
error_reporting = E_ALL
------解決方案--------------------
E_STRICT
這樣可以發現你的程式隱患

關於出錯的原因:
在 pscws3.class.php 中
82行 class PSCWS3
103行 function PSCWS3($dictfile = '')
145行 function __construct($dictfile = '') { $this->PSCWS3($dictfile); }
其中103行的方法名 PSCWS3 與類名相同,被視為建構函式(相容php4)
145行又聲明了建構函式(php5)
所以出錯

在不改動代碼的情況下,可令
error_reporting = E_ALL & ~E_STRICT
來迴避此錯誤

實際應用時應在公用代碼中加入
error_reporting( E_ALL & ~E_STRICT );
而不是修改 php.ini
因為你可能沒有修改 php.ini 的許可權;其他應用可能需要另外的配置
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.