Strict Standards: Declaration of ' ' should be compatible with ' '

前端 未结 5 803
长发绾君心
长发绾君心 2020-12-10 01:38

I just installed woocommerce 2.0 (on Wordpress) on PHP 5.4, and I got this:

Strict Standards: Declaration of WC_Gateway_BACS::process

5条回答
  •  情深已故
    2020-12-10 02:19

    Quote from PHP Manual

    In PHP 5 a new error level E_STRICT is available. Prior to PHP 5.4.0 E_STRICT was not >included within E_ALL, so you would have to explicitly enable this kind of error level in >PHP < 5.4.0. Enabling E_STRICT during development has some benefits. STRICT messages >provide suggestions that can help ensure the best interoperability and forward >compatibility of your code. These messages may include things such as calling non-static >methods statically, defining properties in a compatible class definition while defined in >a used trait, and prior to PHP 5.3 some deprecated features would issue E_STRICT errors >such as assigning objects by reference upon instantiation.

    You are receiving this error because WC_Gateway_BACS::process_payment() declaration is different than WC_Payment_Gateway::process_payment() (might be not the same amount of parameters etc). If WC_Payment_Gateway has no method process_payment, check it's parent class :)

    Also, if you want to disable STRICT errors, add ^ E_STRICT to your error reporting configuration, for example:

    error_reporting(E_ALL ^ E_STRICT);
    

提交回复
热议问题