Static-What is the difference between a version before 5.3 in PHP and a version after 5.3 in a static class?

Source: Internet
Author: User
Tags deprecated
I contact PHP are in contact with 5.6 version of the previous version did not contact to seek the help of Master,

My PHP with 5.3 version will not error,

has been changed to version 5.6 began to error that static classes can not be used, the static public function () {...}

**Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\WWW\weixin\includes\cls_template.php on line 300Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276**

Reply content:

I contact PHP are in contact with 5.6 version of the previous version did not contact to seek the help of Master,

My PHP with 5.3 version will not error,

has been changed to version 5.6 began to error that static classes can not be used, the static public function () {...}

**Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\WWW\weixin\includes\cls_template.php on line 300Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\WWW\weixin\includes\lib_base.php on line 276**

PHP syntax change specification, become rigorous, so previously did not conform to the code will give hints, it is good, you have to get used to.

ecshopcls_image gd_version is not a static method in the library

http://de2.php.net/manual/en/language.oop5.static.php

Calling Non-static methods statically generates an E_STRICT level warning.
Invoking a non-static method in a static manner results in an e_strict level error.

http://us2.php.net/manual/en/errorfunc.constants.php

E_strict Enable to has PHP suggest changes to your code which would ensure the best interoperability and forward Compatibi Lity of your code. Since PHP 5 but not included in E_all until PHP 5.4.0
E_strict enables PHP to modify the code recommendations to ensure the best interoperability and forward compatibility of the code. Starting with PHP 5.4 is enabled by default.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.