Some exceptions that occur after php is upgraded to 5.3 +, such as ereg (); ereg_replace (); function error

Source: Internet
Author: User
Tags ereg
Some errors that occur after php is upgraded to 5.3 +, such as ereg (); ereg_replace (); function errors run in the php5.3 environment, which often result in & nbsp; Deprecated: Functionereg () isdeprecatedin... and Deprecated: Functionereg_replace () some errors that occur after isdeprecatedi php is upgraded to 5.3 +, such as ereg (); ereg_replace (); function error

Run in the php5.3 environment, usually

Deprecated: Function ereg () is deprecated in... and Deprecated: Function ereg_replace () is deprecated in... error messages for these types.
The reason is that php5.3 and later versions do not support the ereg () function, but use the preg_match () function. they do not support the ereg_replace () function, but use the preg_replace () function.
Solution: change unsupported functions to supported functions.
  
For example
If (eregi ('^ ('value', $ value)
Changed:
If (preg_match ('/value/', $ value)
  
For example:
$ String = ereg_replace ('value', '', trim ($ string ));
Changed:
$ String = preg_replace ('{value}', '', trim ($ string ));
  
Solution Deprecated: Assigning the return value of new by reference is deprecated in error

Because php is 5.3, "=" can be directly used in php5.3 ", in the previous tests, the php environment below 5.3 used the "= &" symbol.

The "= &" symbol cannot be used in programs after version 5.3. If the Deprecated: Assigning the return value of new by reference is deprecated in error occurs on your website, do not worry. first locate the file with the error, find whether the program uses the "= &" symbol, and find that the "= &" symbol is used. after removing the "&" symbol, the program runs normally.

Problem: Deprecated: Function set_magic_quotes_runtime () is deprecated in
The cause is that this feature (set_magic_quotes_runtime () has been disabled after PHP5.3.
This feature has been completely removed from PHP6.
You can comment out or delete the wrong row, or add the @ symbol before set_magic_quotes_runtime ().

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.