PHP 7.3 新特性

更多灵活的 Heredoc、 Nowdoc 语法

The closing marker for doc strings is no longer required to be followed by a semicolon or newline. Additionally the closing marker may be indented, in which case the indentation will be stripped from all lines in the doc string.


支持引用的数组, 语法如下 [&$a, [$b, &$c]] = $d. 同理可用在 list() 函数中.

Instanceof 操作可接受 Literals

instanceof now allows literals as the first operand, in which case the result is always FALSE.


增加了编译错误的异常抛出. 部分致命错误将会被转换成异常抛出. 目前仅涉及 TOKEN_PARSE 模式下 token_get_all() 函数抛出的编译错误, 未来将会更好的优化错误处理.


函数和方法调用时, 允许跟随逗号.

Argon2id Support

The --with-password-argon2[=dir] configure argument now provides support for both Argon2i and Argon2id hashes in the password_hash()password_verify()password_get_info(), and password_needs_rehash() functions. Passwords may be hashed and verified using the PASSWORD_ARGON2ID constant. Support for both Argon2i and Argon2id in the password_*() functions now requires PHP be linked against libargon2 reference library ≥ 20161029.

FastCGI 进程管理

FPM 中加入了新的自定义选项:

  1. log_limit

This global option can be used for setting the log limit for the logged line which allows to log messages longer than 1024 characters without wrapping. It also fixes various wrapping issues.

  1. log_buffering

This global option allows an experimental logging without extra buffering.

  1. decorate_workers_output

This pool option allows to disable the output decoration for workers output when catch_workers_output is enabled.

BC 数学函数

bcscale() can now also be used as getter to retrieve the current scale in use.

bcscale — 设置所有 bc 数学函数的默认小数点保留位数


support for LDAP Controls has been added to the LDAP querying functions and ldap_parse_result():


多字节字符编码方案和他们相关的问题相当复杂,超越了本文档的范围。 关于这些话题的更多信息请参考以下 URL 和其他资源。

支持 (更加) 完整的大小写转换


The different casing mapping and folding modes are available through mb_convert_case()

  • MB_CASE_LOWER (used by mb_strtolower())
  • MB_CASE_UPPER (used by mb_strtoupper())
  • MB_CASE_FOLD_SIMPLE (used by case-insensitive operations)

Only unconditional, language agnostic full case-mapping is performed.

使用 Case-Folding 不区分大小写

现在可以使用 case-folding 替换掉 case-mapping 来进行不区分大小写的字符串比较. 这种比较方式将更为宽松.

MB_CASE_TITLE 模式, 执行首字母转换

mb_convert_case() 通过 MB_CASE_TITLE 模式, 执行首字母转换. 另外提供逗号和引号的处理.

支持 Unicode 11

多字节字符串 数据表更新到 Unicode 11.


Multibyte String Functions 目前支持最大字符长度 2G.


Multibyte String 性能明显且全面提升. The largest improvements are in case conversion functions.

Named Captures Support

The mb_ereg_* functions now support named captures. Matching functions like mb_ereg() will now return named captures both using their group number and their name, similar to PCRE:

Additionally, mb_ereg_replace() now supports the \k<> and \k'' 

notations to reference named captures in the replacement string:

\k<> and \k'' can also be used for numbered references, which also works with group numbers greater than 9.


  1. 数组操作函数

  1. list 函数

  1. json throw on error decode 异常可以抛出错误

  1. 增加是否可计数的判断 count


Hello world!
文章已创建 218