Home  >  Article  >  Backend Development  >  Summary of obsolete and expired functions of PHP5.3 and 5.5, php5.35.5_PHP tutorial

Summary of obsolete and expired functions of PHP5.3 and 5.5, php5.35.5_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:23:22917browse

A summary of obsolete and expired functions of PHP5.3 and 5.5, php5.35.5

Many PHP programmers know that starting from PHP5.3, a new error level DEPRECATED has been added, which will be abandoned/expired soon. Let’s sort out each version one by one.

The functions abandoned in php5.3 are:

call_user_method() //使用 call_user_func() 替代
call_user_method_array() //使用 call_user_func_array() 替代
define_syslog_variables()
dl()
ereg() //使用 preg_match() 替代
ereg_replace() //使用 preg_replace() 替代
eregi() //使用 preg_match() 配合 'i' 修正符替代
eregi_replace() //使用 preg_replace() 配合 'i' 修正符替代
set_magic_quotes_runtime() //以及它的别名函数 magic_quotes_runtime()
session_register() //使用 $_SESSION 超全部变量替代
session_unregister() //使用 $_SESSION 超全部变量替代
session_is_registered() //使用 $_SESSION 超全部变量替代
set_socket_blocking() //使用 stream_set_blocking() 替代
split() //使用 preg_split() 替代
spliti() //使用 preg_split() 配合 'i' 修正符替代
sql_regcase()
mysql_db_query() //使用 mysql_select_db() 和 mysql_query() 替代
mysql_escape_string() //使用 mysql_real_escape_string() 替代
mysql_close(); // 将不支持全部关闭, 需要改为:mysql_close($link);

Deprecated passing locale name as string. Use LC_* series constants instead.

The is_dst parameter of mktime(). Use the new time zone handling function instead.

PHP 5.4:

mcrypt_generic_end()
mysql_list_dbs()

PHP 5.5:

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

Among them, PHP 5.3 is the beginning of deprecating functions. Many commonly used previous regular eregs have all replaced preg, but magic quotes. It has been deprecated since PHP 5.3, and was removed in PHP 5.4 . This is considered a big change in PHP 5.3.

PHP 5.4 has added many new features. You can search online for this and many new special writing methods have been added. Maybe old programmers can’t understand the new way of writing~~~
As for PHP 5.5, the MYSQL extension has been removed. It is recommended to use MYSQLI or PDO! ! Many programs using 5.5 will report errors, indicating that mysql_connect is about to expire! ! You will see the following error:

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 improvement of PHP5 compared to 4 is the class part, and the bigger impact is the abandonment of these old habits. Although the version has been upgraded, after all, there are still a large number of 5.1.6-5.2.17 on the market. 5.3 began to abandon many features, which led to many programs not dare to directly use it. 5.5 directly killed a large number of open source products!

PHP has been upgraded to PHP53 or even higher PHP versions ereg_replace, and this function has now been abolished in PHP53

Change to preg_replace

preg_replace("/\{".$found."\}/", $this->db_prefix.$found, $sql);
Try this If it’s still not correct, please check whether the passed parameters are correct

Help PHP53 cancel function replacement problem

$tmplinkhead=ereg_replace("&maxnum".$this->key."=[0-9]*","",$this->linkhead); $preval=0;ereg_replace of this code How to deal with it? ? View original post>>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/840740.htmlTechArticleA summary of obsolete and expired functions of PHP5.3 and 5.5, php5.35.5. Many PHP programmers know that from PHP5 .3 has added a new error level DEPRECATED, which will be abandoned/expired soon. Let’s go...
Statement:
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