PHP 开发者正式 发布 5.5 版本,该版本从去年11月开始开发,历经多个测试版本。PHP 5.5 包含一系列的新特性,例如新的 array_column() 函数以及 foreach() 循环支持标量迭代键;包括 generators 允许开发者实现简单的协程。
同时新版本引入了一个密码哈希函数,可以让开发者轻松实现加盐的安全密码;新增 finally 关键字;foreach 结构支持 list() 构建;其他改进包括 opcode 缓存、代码优化、Zend Optimizer+ 等等,这些对不会对已有代码造成影响,主要是提升语言的性能和稳定性。文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
新的密码哈希 API 使用了 Bcrypt 方法,示例如下:文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
$hash = password_hash($password, PASSWORD_DEFAULT);
校验方法:文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
password_verify($password, $hash);
同时 PHP 开发者也提醒用户,PHP 5.5 也包含一些不向后兼容的内容,包括:不再支持 Windows XP 和 2003 系统;不区分大小写的匹配函数、类;常数名称跟 Locale 无关,这对一些使用非 ASCII 代码的常量名的开发者需要注意的。完整的关于 PHP 5.5 不向后兼容列表请看 list of new features and possible incompatibilities文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
PHP 5.5 的完整改进记录请看 NEWS file文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
下载地址:文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
http://windows.php.net/qa/ (Windows)
http://php.net/downloads.php#v5 (源码包)文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
===========原文========文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
The PHP development team is proud to announce the immediate availability of PHP 5.5.0. This release includes a large number of new features and bug fixes.文章源自陈学虎-https://chenxuehu.com/article/2013/06/1226.html
The key features of PHP 5.5.0 include:
- Added generators and coroutines.
- Added the finally keyword.
- Added a simplified password hashing API.
- Added support for constant array/string dereferencing.
- Added scalar class name resolution via ::class.
- Added support for using empty() on the result of function calls and other expressions.
- Added support for non-scalar Iterator keys in foreach.
- Added support for list() constructs in foreach statements.
- Added the Zend OPcache extension for opcode caching.
- The GD library has been upgraded to version 2.1 adding new functions and improving existing functionality.
- A lot more improvements and fixes.
Changes that affect compatibility:
- PHP logo GUIDs have been removed.
- Windows XP and 2003 support dropped.
- Case insensitivity is no longer locale specific. All case insensitive matching for function, class and constant names is now performed in a locale independent manner according to ASCII rules.
For users upgrading from PHP 5.4, a migration guide is available detailing the changes between 5.4 and 5.5.0.
For a full list of changes in PHP 5.5.0, see the ChangeLog.
评论