对本扩展的类/函数/方法有以下更新。
Version | Function | Description |
---|---|---|
5.5.1 | hex2bin | A warning is thrown if the input string is invalid hexadecimal string. |
5.4.1 | hex2bin | A warning is thrown if the input string is of odd length. In PHP 5.4.0 the string was silently accepted, but the last byte was truncated. |
5.4.0 | get_html_translation_table | The constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added. |
get_html_translation_table | The default value for the encoding parameter was changed to UTF-8. | |
html_entity_decode | Default encoding changed from ISO-8859-1 to UTF-8. | |
html_entity_decode | The constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added. | |
htmlentities | The default value for the encoding parameter was changed to UTF-8. | |
htmlentities | The constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added. | |
htmlspecialchars | The default value for the encoding parameter was changed to UTF-8. | |
htmlspecialchars | The constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added. | |
htmlspecialchars_decode | 增加了 ENT_HTML401、ENT_XML1、 ENT_XHTML 和 ENT_HTML5 等常量。 | |
number_format | This function now supports multiple bytes in dec_point and thousands_sep. Only the first byte of each separator was used in older versions. | |
5.3.4 | get_html_translation_table | The encoding parameter was added. |
5.3.2 | crypt | 基于 Ulrich Drepper 的实现,新增基于 SHA-256 算法和 SHA-512 算法的 crypt。 |
crypt | 修正了 Blowfish 算法由于非法循环导致的问题,返回“失败”字符串(“*0” 或 “*1”)而不是转而使用 DES 算法。 | |
5.3.0 | crypt | PHP 现在包含了它自己的 MD5 Crypt 实现,包括标准 DES 算法,扩展的 DES 算法以及 Blowfish 算法。如果系统缺乏相应的实现,那么 PHP 将使用它自己的实现。 |
htmlentities | The constant ENT_IGNORE was added. | |
htmlspecialchars | The constant ENT_IGNORE was added. | |
nl2br | 新增可选的 is_xhtml 参数。 | |
setlocale | This function now throws an E_DEPRECATED notice if a string is passed to the category parameter instead of one of the LC_* constants. | |
stristr | 新增可选的 before_needle 参数。 | |
strlen | Prior versions treated arrays as the string Array, thus returning a string length of 5 and emitting an E_NOTICE level error. | |
strstr | 新增可选的 before_needle 参数。 | |
5.2.5 | addcslashes | The escape sequences \v and \f were added. |
5.2.3 | htmlentities | The double_encode parameter was added. |
htmlspecialchars | The double_encode parameter was added. | |
5.2.2 - 5.2.6 | substr | If the start parameter indicates the position of a negative truncation or beyond, false is returned. Other versions get the string from start. |
5.1.0 | explode | 支持负数的 limit |
md5_file | 函数改用流 API。这意味着能够配合封装器使用该函数,比如 md5_file('http://example.com/..')。 | |
sha1_file | 改变函数以使用流 API。这意味着可以使用包装器,比如 sha1_file('http://example.com/..')。 | |
str_word_count | 新增 charlist 参数。 | |
substr_compare | 允许使用负数的 offset 参数。 | |
substr_count | 新增 offset 和 length 参数。 | |
5.0.0 | html_entity_decode | Support for multi-byte encodings was added. |
md5 | 新增 raw_output 参数。 | |
md5_file | 新增 raw_output 参数。 | |
sha1 | 新增 raw_output 参数。 | |
sha1_file | 新增 raw_output 参数。 | |
str_ireplace | 新增 count 参数。 | |
str_replace | 新增 count 参数。 | |
strip_tags | strip_tags 变为二进制安全的。 | |
strrpos | 参数 needle 可以是一个多字符的字符串。 | |
strrpos | 引入 offset 参数。 | |
4.3.3 | str_replace | 函数行为改变。旧的版本中存在一个 BUG —— 当 search 和 replace 两个参数都是数组的时候,将导致空的 search 索引被跳过,但是却没有同时前移 replace 内部指针。该错误发生在 PHP 4.3.3,任何依赖于此 BUG 的脚本应该先除去空的查找值,从而模拟原始的行为。 |
substr_replace | All parameters now accept arrays. | |
4.3.0 | implode | glue变为可选参数 |
setlocale | Passing multiple locales became possible. | |
str_rot13 | 函数行为被修正。在此修正之前,str 参数也会被改变,因为它是通过引用传递的。 | |
strcspn | 新增 start 和 length 参数。 | |
strip_tags | HTML 注释总是被删除。 | |
stristr | stristr 变为二进制安全的。 | |
strrchr | 该函数是二进制安全的。 | |
strspn | 新增 start 和 length 参数。 | |
strstr | strstr 成为二进制安全的。 | |
4.2.3 | strcoll | 函数在 Win32 平台可用。 |
4.2.0 | setlocale | Passing category as a string is now deprecated, use the above constants instead. Passing them as a string (within quotes) will result in a warning message. |
4.1.0 | htmlentities | The encoding parameter was added. |
htmlspecialchars | The encoding parameter was added. | |
ltrim | 新增 charlist 参数 | |
rtrim | 新增 charlist 参数。 | |
trim | 新增可选的 charlist 参数。 | |
4.0.6 | sprintf | Support for argument numbering/swapping was added |
4.0.5 | nl2br | nl2br 成为 XHTML 兼容的操作。所有的旧版本都会在 string 的新行之前插入 '<br>' 而不是 '<br />'。 |
str_replace | 大多数参数都可以为数组。 | |
4.0.3 | htmlentities | The flags parameter was added. |
parse_str | 添加了参数 arr | |
wordwrap | 新增可选的 cut 参数。 | |
4.0.1 | explode | 增加了参数 limit |