前言
随着大量的框架使用composer和namespace,渐渐的线上环境也从之前的5.3变成了5.4或者5.5甚至5.6,随着7月份php7的发布,会有更多的公司采用新版本。
之前好久就想写这样的一片文章,来说明下各个版本的差异,这次算是拿出时间了。
这次的是第一篇,目前规划写三篇
php5.4.0php5.5.0php5.6.0一方面是对自己的知识的整理,一方面是对自己的一次提升。
官方说明
官方文档地址 http://php.net/changelog-5.php#5.4.0
详细说明
01 mar 2012
原文
autoconf 2.59+ is now supported (and required) for generating the configure script with ./buildconf. autoconf 2.60+ is desirable otherwise the configure help order may be incorrect.翻译
autoconf 2.59 +现在支持(需要)生成配置脚本/ buildconf。autoconf 2.60 +是理想的配置,否则有可能是不正确的。
autoconf
php编译安装的时候需要的依赖软件,所以新版本对应配套的软件也要换成最新的对性能来讲才保险啊~
removed legacy features 移除的特性
原文
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.翻译
break/continue$ var语法。安全模式和所有相关的ini选项。register_globals和register_long_arrays ini选项。import_request_variables()。allow_call_time_pass_reference。define_syslog_variables ini选项及其相关的功能。highlight.bg ini选项。会话错误兼容模式(session.bug_compat_42和session.bug_compat_warn ini选项)。session_is_registered(),session_register()和session_unregister()功能。y2k_compliance ini选项。magic_quotes_gpc,magic_quotes_runtime和magic_quotes_sybase ini选项。get_magic_quotes_gpc,get_magic_quotes_runtime保存但始终返回false,set_magic_quotes_runtime引发e_core_error。不再支持putenv(“tz = ..”)设置时区。如果不设置时区与时区date.timezone或date_default_timezone_set()除去猜测算法。而不是猜测的时区,“utc”现在是用来代替。我是拿百度翻译来的我会乱说吗? =_=
break/continue
移除了break/continue $var语法
在5.4之前,我们可以通过传递后面的参数来控制跳出或者停止若干层的循环,然而在5.4.0的版本之后,就去除了这个特性。
break$c;continue$c;
break and continue accepts a number, that specify the number of nested loops, that should be breaked up, or continued.
参考资料
http://stackoverflow.com/questions/6517401/what-is-the-break-continue-var-syntax-will-be-removed-in-php-5-4http://php.net/control-structures.breaksafe mode and all related ini options. 去除安全模式以及在配置文件的选项
php 的安全模式是为了试图解决共享服务器(shared-server)安全问题而设立的。在结构上,试图在 php 层上解决这个问题是不合理的,但修改 web 服务器层和操作系统层显得非常不现实。因此许多人,特别是 isp,目前使用安全模式。
语言的发展是在不断的进步的啊,也是一个不断试错改错的过程。^_^
保安措施和安全模式,也就是移除了php.ini中所有safe_mode相关的配置项被安全模式限制或屏蔽的函数 。 在安全限制模式下,有些函数不能被使用。这个限制也将被移除参考资料
http://php.net/manual/zh/features.safe-mode.phpregister_globals and register_long_arrays ini options.
这两个配置项因为性能关系被移除了。
参考资料
http://php.net/manual/zh/ini.core.php#ini.register-globalsimport_request_variables()
import_request_variables — 将 get/post/cookie 变量导入到全局作用域中
bool import_request_variables ( string types[,string
以上就介绍了php540版本changelog详解(上),包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。