[Search] php upgrades to 5.3 to generate problem fixes (Continuous updates)

Source: Internet
Author: User
Deprecatedfunctions ※posixregex series PHP5.3.0 and later regex. If you want to use the PCRE specification, POSIXRegex is not recommended (Uniform Regex to avoid too many specifications ?). Therefore, the following is a list of functions (POSIX) that are not recommended and recommended to be replaced with PCRE. For details, see PHP: Differen.

Deprecated functions ※posix Regex series PHP 5.3.0 and later regex. If you want to use the PCRE specification, POSIX Regex is not recommended (Uniform Regex to avoid too many specifications ?). Therefore, the following is a list of functions (POSIX) that are not recommended and recommended to be replaced with PCRE. For details, see PHP: Differen.

Deprecated functions

※Posix Regex Series

For regex after PHP 5.3.0, we hope to use the PCRE specification. POSIX Regex is not recommended (Uniform Regex to avoid too many specifications ?).
Therefore, the following is a list of functions (POSIX) that are not recommended and recommended to be replaced with PCRE. For details, see PHP:
Differences from POSIX regex
* POSIX → PCRE
* Ereg_replace () → preg_replace ()
* Ereg () → preg_match ()
* Ereg_replace () → preg_replace ()
* Eregi_replace () → preg_replace ()

This function is case insensitive. Replace it with preg_replace ("/original rule/I ",...);
* Eregi () → preg_match ()
* Split () → preg_split ()
* Spliti () → preg_split ()
* SQL _regcase () → No equivalent
* Split of regex is required, which can be replaced by preg_split ().
* No regex is required. You only need to quickly split a fixed string and replace it with explode (). (The speed is much faster than that of regex)

In addition:

If php5.3 is required, modify the following code in php. ini:

; Extension = php_mbstring.dll to; extension = php_mbstring.dll

; Mbstring. func_overload = 0 to; mbstring. func_overload = 7

Deprecated grammar

※Assigning the return value of new by reference is deprecated in

Solution: After php5.3 starts, the "= &" symbol in php is abolished. to copy the file, use = to reference it directly. The details are as follows:

1. PHP5 object replication adopts the reference method;
2. If the reference method is not used, add the keyword clone when copying the object;
3. If you want to change some attributes during the replication process, add function _ clone ();

Or block errors.

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.