Table of Contents
Some errors occurred after php was upgraded to 5.3, such as ereg(); ereg_replace(); function error, eregeg_replace
Home Backend Development PHP Tutorial Some errors occurred after php was upgraded to 5.3, such as ereg(); ereg_replace(); function error, eregeg_replace_PHP tutorial

Some errors occurred after php was upgraded to 5.3, such as ereg(); ereg_replace(); function error, eregeg_replace_PHP tutorial

Jul 12, 2016 am 09:03 AM

Some errors occurred after php was upgraded to 5.3, such as ereg(); ereg_replace(); function error, eregeg_replace

often occurs when running in php5.3 environment

Deprecated: Function ereg() is deprecated in... and Deprecated: Function ereg_replace() is deprecated in... These types of error messages.
The reason is: PHP5.3 or above does not support the ereg() function, but uses the preg_match() function; it does not support the ereg_replace() function, but uses the preg_replace() function.
Solution: Just change the unsupported function to a supported function.
 
 For example
 if(eregi('^('value', $value)
 Changed to:
 if(preg_match('/value/', $value)
  🎜> Another example:
$string = ereg_replace(' value', ' ', trim($string));
Change to:
$string = preg_replace('{ value}', ' ', trim($string));
 
Solution to Deprecated: Assigning the return value of new by reference is deprecated in error

Because our current php is 5.3, you can use "=" directly in php5.3. In the past, because the local testing was in PHP environments below 5.3, the "=&" symbol was used.

After version 5.3, the "=&" symbol is no longer allowed in programs. If the error Deprecated: Assigning the return value of new by reference is deprecated in appears on your website, don’t worry. First locate the file with the error and check whether “=&” is used in the program. You will find that “=” is used. &" symbol, the program runs normally after removing the '&' symbol.

Problem: Deprecated: Function set_magic_quotes_runtime() is deprecated in The reason for this prompt is that this feature (set_magic_quotes_runtime()) has been turned off after PHP5.3.
And this feature has been completely removed in PHP6.
You can comment or delete the wrong line, or add the @ symbol in front of set_magic_quotes_runtime()

http://www.bkjia.com/PHPjc/1077537.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1077537.htmlTechArticleSome errors occurred after php was upgraded to 5.3, such as ereg(); ereg_replace(); function reported an error, eregeg_replace is in When running in the php5.3 environment, Deprecated: Function ereg() is de...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

Notifications in Laravel

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

Announcement of 2025 PHP Situation Survey

See all articles