PHP5.3 and 5.5 obsolete and outdated functions summary, php5.35.5_php Tutorial

Source: Internet
Author: User
Tags deprecated ereg

PHP5.3 and 5.5 obsolete and outdated functions are summarized, php5.35.5


Many PHP programmers know that a new error level has been added from PHP5.3 to deprecated, which is about to be discarded/expired. Let's comb a version of this.

The functions that are discarded in php5.3 are:

Call_user_method ()//Use Call_user_func () instead of call_user_method_array ()//Use Call_user_func_array () instead of Define_syslog_ Variables () DL () Ereg ()//Use Preg_match () Alternative ereg_replace ()//Use Preg_replace () instead of eregi ()//Use Preg_match () with ' I ' modifier instead of Ereg I_replace ()//Use Preg_replace () with ' I ' modifier instead of set_magic_quotes_runtime ()//and its alias function magic_quotes_runtime () session_ Register ()//use $_session all variables instead of session_unregister ()//use $_session all variables instead of session_is_registered ()//Use $_session Super all variable substitution set_socket_blocking ()//using stream_set_blocking () instead of split ()//using Preg_split () instead of spliti ()//using Preg_split () with ' I ' repair Positive substitution sql_regcase () mysql_db_query ()//using mysql_select_db () and mysql_query () instead of mysql_escape_string ()//using Mysql_real_ Escape_string () replaces Mysql_close (); All closures will not be supported and need to be changed to: Mysql_close ($link);

Obsolete to pass the locale name as a string. Use the Lc_* series constants instead.

The IS_DST parameter of the Mktime (). Use the new time zone handler function override.

PHP 5.4:

Mcrypt_generic_end () Mysql_list_dbs ()

PHP 5.5:

MCRYPT_CBC () MCRYPT_CFB () MCRYPT_ECB () MCRYPT_OFB ()

Of these,PHP 5.3 is the beginning of obsolete functions, many of the usual former regular ereg all replace Preg, but magic quotes. Since PHP 5.3 has been deprecated, PHP 5.4 has been removed . This is a big change in PHP 5.3.

PHP 5.4 began to add a lot of features, this can be searched online, many new special wording. May follow the new wording, the old programmer can not understand very much ~ ~ ~
As for PHP 5.5, actually removed the MySQL extension, it is recommended to use MYSQLI or PDO!! With 5.5 of many programs will be an error, indicating that mysql_connect is about to expire!! You will see the following error:

Deprecated:mysql_connect (): The MySQL extension is Deprecated and would be a removed in the Future:use mysqli or PDO Instea D in E:testnew 6.php to line 6

PHP5 is the most important part of the class relative to 4, and the effect is to discard the old habits. Although the version has been upgraded, but eventually the market is still a large number of 5.1.6-5.2.17. 5.3 began to discard many features, which led to a lot of programs also dare not directly on, 5.5. Direct seconds kill a lot of open source products!


PHP has been upgraded to PHP53 and even higher PHP version ereg_replace, and this function is now abolished in PHP53.

Change into Preg_replace

Preg_replace ("/\{". $found. " \}/", $this->db_prefix. $found, $sql);
Let's try this, and if it's not right, you check to see if the parameters are correct.

Help PHP53 Cancel function substitution problem

$tmplinkhead =ereg_replace ("&maxnum". $this->key. " =[0-9]* "," ", $this->linkhead); $preval = 0; How is the ereg_replace of this code handled?? View Original Posts >>

http://www.bkjia.com/PHPjc/840740.html www.bkjia.com true http://www.bkjia.com/PHPjc/840740.html techarticle PHP5.3 and 5.5 obsolete and outdated functions summarized, php5.35.5 many PHP programmers know, starting from PHP5.3 to join a new error level deprecated, will be discarded/expired. Here we come ...

  • 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.