PHP5.3 and 5.5 discard/expire function arrangement _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags ereg
PHP5.3 and 5.5 discard expired functions. PHP5.3 and 5.5 discard expiration functions are all written into PHP. from PHP5.3, a new error level DEPRECATED is added, which is about to discard expiration. We have been using different versions. Sort out obsolete/expired functions in PHP 5.3 and 5.5

I believe that PHP has added a new error level DEPRECATED since PHP5.3, which is about to be discarded/expired. We have been using different versions.

Functions abandoned in php5.3 include:

The code is as follows:

Call_user_method () (use call_user_func)
Call_user_method_array () (use call_user_func_array)
Define_syslog_variables ()
Dl ()
Ereg () (use preg_match () instead)
Ereg_replace () (use preg_replace)
Eregi () (replaced by preg_match () and 'I' modifier)
Eregi_replace () (use preg_replace () in combination with the 'I' modifier)
Set_magic_quotes_runtime () and its alias function magic_quotes_runtime ()
Session_register () (use $ _ SESSION to replace all variables)
Session_unregister () (use $ _ SESSION to replace all variables)
Session_is_registered () (use $ _ SESSION to replace all variables)
Set_socket_blocking () (use stream_set_blocking)
Split () (use preg_split () instead)
Spliti () (replaced by preg_split () and 'I' modifier)
SQL _regcase ()
Mysql_db_query () (replace mysql_select_db () with mysql_query)
Mysql_escape_string () (use mysql_real_escape_string)

Mysql_close (); // You cannot close all of them. you need to change it 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.

Python 5.4

The code is as follows:

Mcrypt_generic_end ()
Mysql_list_dbs ()

Python 5.5

The code is as follows:
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 the preg, which I know before. All are replaced, but the Magic quotation marks are used .. 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 ~~~

What does PHP 5.5 say? I found it today ~ The MYSQL extension is removed. we recommend that you use MYSQLI or PDO... If you use more than 5.5 programs, an error will be 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, resulting in many programs do not dare to directly go up,. directly flash a large number of open-source haha ~~~

Http://www.bkjia.com/PHPjc/834972.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/834972.htmlTechArticlePHP 5.3 and 5.5 abandon/expire function arrangement do PHP believe that all know, from PHP5.3 began to add a new error level DEPRECATED, will be discarded/expired. We have been using different versions. In...

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.