Static-what are the differences between PHP versions earlier than 5.3 and PHP versions later than 5.3 In the static class?

Source: Internet
Author: User
I have contact with PHP versions earlier than version 5.6 and have not contact experts for help. My PHP version 5.3 does not report an error. If I have changed to version 5.6, I began to report an error saying that static classes cannot be used, staticpublicfunction (){....} {code ...} I have contact with PHP versions earlier than version 5.6,

My PHP version 5.3 does not report an error,

If it has been changed to version 5.6, an error is reported that the static class cannot be used. 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 have contact with PHP versions earlier than version 5.6,

My PHP version 5.3 does not report an error,

If it has been changed to version 5.6, an error is reported that the static class cannot be used. 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 becomes more standardized and more rigorous, so the code that does not comply with the specifications will be prompted in the past. This is a good thing and you should get used to it.

ecshopOfcls_imageLibrarygd_versionNot a static method

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

Calling non-static methods statically generates an E_STRICT level warning.
Calling a non-static method in static mode will result in an E_STRICT error.

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

E_STRICT Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. Since PHP 5 but not supported ded in E_ALL until PHP 5.4.0
E_STRICT enables PHP code modification suggestions to ensure the best code interoperability and forward compatibility. PHP 5.4 is enabled by default.

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.