This article mainly introduces the disposal and expiration functions of PHP5.3 and 5.5. many PHP programmers know that a new error level DEPRECATED has been added since PHP5.3, will 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!