search
Homephp教程php手册php5.3 中废弃的功能全集

在看一些php5.3版本以前的教程时,举的例子在php5.3 中将得到警告。 如 Function ereg_replace() is deprecated PHP 5.3 中令人瞩目的废弃有3类。一是POSIX的正则表达式全部用Perl兼容正则表达式(PCRE)替代。二是Session相关用$_SESSION[] 全局变量来操作。

在看一些php5.3版本以前的教程时,举的例子在php5.3 中将得到警告。 如

Function ereg_replace() is deprecated

PHP 5.3 中令人瞩目的废弃有3类。一是POSIX的正则表达式全部用Perl兼容正则表达式(PCRE)替代。二是Session相关用$_SESSION[] 全局变量来操作。三是对mysql操作的一些改变。

改变详情:

PHP 5.3.0 新增了两个错误等级: E_DEPRECATEDE_USER_DEPRECATED. 错误等级 E_DEPRECATED 被用来说明一个函数或者功能已经被弃用. E_USER_DEPRECATED 等级目的在于表明用户代码中的弃用功能, 类似于 E_USER_ERRORE_USER_WARNING 等级.

下面是被弃用的 INI 指令列表. 使用下面任何指令都将导致 E_DEPRECATED 错误.

  • define_syslog_variables
  • register_globals
  • register_long_arrays
  • safe_mode
  • magic_quotes_gpc
  • magic_quotes_runtime
  • magic_quotes_sybase
  • 弃用 INI 文件中以 ‘#’ 开头的注释.

弃用函数:

  • 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() 替代)
  • 废弃以字符串传递区域设置名称. 使用 LC_* 系列常量替代.
  • mktime() 的 is_dst 参数. 使用新的时区处理函数替代.

弃用的功能:

  • 弃用通过引用分配 new 的返回值.
  • 调用时传递引用被弃用.
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

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.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor