search
HomeBackend DevelopmentPHP TutorialSummary of obsolete and expired functions of PHP5.3 and 5.5, php5.35.5_PHP tutorial

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
提高 Python 代码可读性的五个基本技巧提高 Python 代码可读性的五个基本技巧Apr 12, 2023 pm 08:58 PM

Python 中有许多方法可以帮助我们理解代码的内部工作原理,良好的编程习惯,可以使我们的工作事半功倍!例如,我们最终可能会得到看起来很像下图中的代码。虽然不是最糟糕的,但是,我们需要扩展一些事情,例如:load_las_file 函数中的 f 和 d 代表什么?为什么我们要在 clay 函数中检查结果?这些函数需要什么类型?Floats? DataFrames?在本文中,我们将着重讨论如何通过文档、提示输入和正确的变量名称来提高应用程序/脚本的可读性的五个基本技巧。1. Comments我们可

CRPS:贝叶斯机器学习模型的评分函数CRPS:贝叶斯机器学习模型的评分函数Apr 12, 2023 am 11:07 AM

连续分级概率评分(Continuous Ranked Probability Score, CRPS)或“连续概率排位分数”是一个函数或统计量,可以将分布预测与真实值进行比较。机器学习工作流程的一个重要部分是模型评估。这个过程本身可以被认为是常识:将数据分成训练集和测试集,在训练集上训练模型,并使用评分函数评估其在测试集上的性能。评分函数(或度量)是将真实值及其预测映射到一个单一且可比较的值 [1]。例如,对于连续预测可以使用 RMSE、MAE、MAPE 或 R 平方等评分函数。如果预测不是逐点

详解JavaScript函数如何实现可变参数?(总结分享)详解JavaScript函数如何实现可变参数?(总结分享)Aug 04, 2022 pm 02:35 PM

js是弱类型语言,不能像C#那样使用param关键字来声明形参是一个可变参数。那么js中,如何实现这种可变参数呢?下面本篇文章就来聊聊JavaScript函数可变参数的实现方法,希望对大家有所帮助!

盘点Python内置函数sorted()高级用法实战盘点Python内置函数sorted()高级用法实战May 13, 2023 am 10:34 AM

一、前言前几天在Python钻石交流群有个叫【emerson】的粉丝问了一个Python排序的问题,这里拿出来给大家分享下,一起学习下。其实这里【瑜亮老师】、【布达佩斯的永恒】等人讲了很多,只不过对于基础不太好的小伙伴们来说,还是有点难的。不过在实际应用中内置函数sorted()用的还是蛮多的,这里也单独拿出来讲一下,希望下次再有小伙伴遇到的时候,可以不慌。二、基础用法内置函数sorted()可以用来做排序,基础的用法很简单,看个例子,如下所示。lst=[3,28,18,29,2,5,88

学Python,还不知道main函数吗学Python,还不知道main函数吗Apr 12, 2023 pm 02:58 PM

Python 中的 main 函数充当程序的执行点,在 Python 编程中定义 main 函数是启动程序执行的必要条件,不过它仅在程序直接运行时才执行,而在作为模块导入时不会执行。要了解有关 Python main 函数的更多信息,我们将从如下几点逐步学习:什么是 Python 函数Python 中 main 函数的功能是什么一个基本的 Python main() 是怎样的Python 执行模式Let’s get started什么是 Python 函数相信很多小伙伴对函数都不陌生了,函数是可

解决过期的Win8系统安全证书问题解决过期的Win8系统安全证书问题Dec 25, 2023 pm 04:38 PM

安全证书是我们网络生活的一种安全凭证,通过它我们才能登陆各种网站,应该有很多win8系统用户遇到过安全证书过期的时候,那么Win8系统安全证书过期怎么解决呢?Win8系统安全证书过期怎么解决:1、首先打开运行窗口,输入命令mmc,回车确定。2、然后点击右上角的文件,再点击添加/删除管理单元。3、再找到并点击左侧的证书选项,选择添加。4、随后选择我的用户账户,点击完成。5、继续点击确定。6、打开控制台1中的证书,选择受信任的根证书颁发机构,在点击打开证书,删除右侧的过期证书。7、最后重新安装证书即

Redis如何实现数据过期自动清理功能Redis如何实现数据过期自动清理功能Nov 07, 2023 pm 04:48 PM

Redis是一个开源的内存数据结构存储系统,可以用来存储和读取键值对,支持多种数据结构,比如字符串、列表、哈希表、集合等。由于Redis是一个基于内存的存储系统,如果没有对数据进行过期自动清理,很容易导致内存溢出。因此本文将介绍Redis如何实现数据过期自动清理功能,并提供具体的代码示例。一、Redis数据过期概述Redis支持设置数据的过期时间,过期时间可

解决并解释localstorage过期所带来的影响解决并解释localstorage过期所带来的影响Jan 13, 2024 pm 12:41 PM

localstorage过期的影响及解决方法,需要具体代码示例导言:在网页开发中,我们经常使用localStorage来存储和获取数据。localStorage是HTML5中新增的一种存储数据的方式,可以用来在网页中保存和读取数据,比如用户登录状态、用户偏好设置等。然而,由于localStorage有一定的限制和过期时间的问题,当数据过期时也会对网页的运行产

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),