PHP5.3 and 5.5 disposal and expiration functions are summarized, php5.35.5

Source: Internet
Author: User
Tags ereg

PHP5.3 and 5.5 disposal and expiration functions are summarized, php5.35.5

Many PHP programmers know that a new error-level DEPRECATED has been added since PHP5.3 and is about to be discarded/expired. Next, let's sort out the versions one by one.

Functions abandoned in php5.3 include:

Call_user_method () // replace call_user_func () with call_user_method_array () // replace define_syslog_variables () dl () ereg () // replace ereg_replace () with preg_match () // use preg_replace () to replace eregi () // use preg_match () with the 'I' modifier to replace eregi_replace () // use preg_replace () use the 'I' modifier to replace set_magic_quotes_runtime () // and Its alias function magic_quotes_runtime () session_register () // use $ _ SESSION to replace session_unregister () // use $ _ SESSION to replace session_is_registered () // use $ _ SESSION to replace set_socket_blocking () // use stream_set_blocking () to replace split () // use preg_split () to replace spliti () // use preg_split () with the 'I' modifier to replace SQL _regcase () mysql_db_query () // use mysql_select_db () and mysql_query () replace mysql_escape_string () // replace mysql_real_escape_string () with mysql_close (); // you cannot close all statements. You need to change them to mysql_close ($ link );

The name of the Region passed by the string is discarded. Use the LC _ * series constant instead.

The is_dst parameter of mktime (). It is replaced by the new time zone handler.

In PHP 5.4:

mcrypt_generic_end()mysql_list_dbs()

In PHP 5.5:

mcrypt_cbc()mcrypt_cfb()mcrypt_ecb()mcrypt_ofb()

Among them, PHP 5.3 is the beginning of the Waste Function, many common old regular ereg all replace preg, but magic quotes. PHP 5.3 was removed after it was deprecated from PHP 5.4. This is a big change in PHP 5.3.

PHP 5.4 has introduced many new features, so you can search for them online and add many special writing methods. The old programmers may not understand the new method ~~~
For PHP 5.5, the MYSQL extension is removed. We recommend that you use MYSQLI or PDO !! If you use more than 5.5 programs, an error is reported, prompting that mysql_connect is about to expire !! The following error is displayed:

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:testnew 6.php on line 6

The biggest cross-step of PHP5 compared with 4 is the class, and the most influential is to discard these old habits. Although the version has been being upgraded, there are still a large number of 5.1.6-5.2.17 in the market. 5.3 began to discard many features, which led to the failure of many programs to directly launch.. A large number of open-source products were directly killed in seconds!


PHP has been upgraded to the PHP version ereg_replace of PHP53 or later, and this function has been abolished in PHP53.

Change to preg_replace

Preg_replace ("/\ {". $ found. "\}/", $ this-> db_prefix. $ found, $ SQL );
If this is not the case, check whether the passed parameters are correct.

Helping PHP53 cancel function replacement

$ Tmplinkhead = ereg_replace ("& maxnum ". $ this-> key. "= [0-9] *", "", $ this-> linkhead); $ preval = 0; how to deal with ereg_replace in this code ?? View Original post>

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.