PHP5.4经历了多个rc版本,终于release了。这个版本升级非常多

关键新功能:
1、traits, 面向对象中提高代码重用的一种机制
2、a shortened array syntax, 短数组语法
如:
   
   
   
   
  1. $array = array(     
  2.  "foo" => "bar"
  3. "bar" => "foo" 
  4. ); 
  5.   
  6. // as of PHP 5.4 
  7. $array = [ 
  8. "foo" => "bar"
  9. "bar" => "foo" 
  10. ]; 
  11. ?> 
3、a built-in webserver for testing purposes
$ php -S localhost:8000
增加了一个内置的Web Server,用于测试环境。
http://php.net/manual/en/features.commandline.webserver.php
 
Built-in web server
 
其他功能
 
支持二进制格式 ,0b开头表示二进制
Added binary numbers format (0b001010).
 
类型提示
Added callable typehint.
 
在html中不再需要麻烦地写 了,PHP自身支持
 
ext/mysql, mysqli and pdo_mysql now use mysqlnd by default.
 
Added new json_encode() option JSON_UNESCAPED_UNICODE. #53946.
 
被删掉的特性
 

break/continue $var syntax.

Safe mode and all related ini options.

register_globals and register_long_arrays ini options.

import_request_variables().

allow_call_time_pass_reference.

define_syslog_variables ini option and its associated function.

highlight.bg ini option.

Session bug compatibility mode (session.bug_compat_42 and session.bug_compat_warn ini options).

session_is_registered(), session_register() and session_unregister() functions.

y2k_compliance ini option.

magic_quotes_gpc, magic_quotes_runtime and magic_quotes_sybase ini options. get_magic_quotes_gpc, get_magic_quotes_runtime are kept but always return false, set_magic_quotes_runtime raises an E_CORE_ERROR.

Removed support for putenv("TZ=..") for setting the timezone.

Removed the timezone guessing algorithm in case the timezone isn't set with date.timezone or date_default_timezone_set(). Instead of a guessed timezone, "UTC" is now used instead.

 

 

总之,5.4提升了很多,但刚出来还没有实用过,值得期待,暂不使用到生产环境。

change log 参见这里

http://php.net/ChangeLog-5.php