手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2012年03月14日的文章

PHP 5.4 更新

有些更新由于没有仔细看,结果就出错了,所以,还是COPY出来,以后查起来方便一点,顺便告诉自己,session函数有部分不能用了。。。

Backward Incompatible Changes

Although most existing PHP 5 code should work without changes, please take note of some backward incompatible changes:

  • Safe mode is no longer supported. Any applications that rely on safe mode may need adjustment, in terms of security.【如果有运行在安全模式下的程序,要发了。。。。】
  • Magic quotes has been removed. Applications relying on this feature may need to be updated, to avoid security issues. get_magic_quotes_gpc() and get_magic_quotes_runtime() now always return FALSE. 【这个是早就知道了】set_magic_quotes_runtime() raises an E_CORE_ERROR level error.
  • The register_globals and register_long_arrays php.ini directives have been removed.【第二个函数没用过,现在也不用了】
  • Call-time pass by reference has been removed.【早就不用了。。。。】
  • The break and continue statements no longer accept variable arguments (e.g., break 1 + foo() * $bar;). Static arguments still work, such as break 2;.【HOHO,这个嘛。。。不影响 】
  • In the date and time extension, the timezone can no longer be set using the TZ environment variable. Instead you have to specify a timezone using the date.timezone php.ini option or date_default_timezone_set() function. PHP will no longer attempt to guess the timezone, and will instead fall back to "UTC" and issue a E_WARNING.【这个可能需要注意了。。。。】
  • Non-numeric string offsets - e.g. $a['foo'] where $a is a string - now return false on isset() and true on empty(), and produce a E_WARNING if you try to use them. Offsets of types double, bool and null produce a E_NOTICE. Numeric strings (e.g. $a['2']) still work as before. Note that offsets like '12.3' and '5 foobar' are considered non-numeric and produce a E_WARNING, but are converted to 12 and 5 respectively, for backward compatibility reasons.【。。。。。会有意外了】
  • Converting an array to a string will now generate an E_NOTICE level error, but the result of the cast will still be the string "Array".
  • Turning NULL, FALSE, or an empty string into an object by adding a property will now emit an E_WARNING level error, instead of E_STRICT.
  • Parameter names that shadow super globals now cause a fatal error. This prohibits code like function foo($_GET, $_POST) {}.【难道有人这么用过???】
  • The Salsa10 and Salsa20 hash algorithms have been removed.
  • array_combine() now returns array() instead of FALSE when two empty arrays are provided as parameters.
  • If you use htmlentities() with asian character sets, it works like htmlspecialchars() - this has always been the case in previous versions of PHP, but now an E_STRICT level error is emitted.

The following keywords are now reserved, and may not be used as names by functions, classes, etc.

The following functions have been removed from PHP:

升级sablog 2.0失败

纠结了很久,还是失败了。
看了一下出问题的step,发现是drop table的问题,我开始以为是我的权限有问题。但。。。我设置为ROOT也没用。所以暂时不升级了。真纠结啊

---------
顺便:
从PHP5.4开始,session_register函数禁用了。所以,如果还在使用Sablog1.6的人,记着。。。seccode.php中,这一行注释掉,否则。。。验证码就出不来了。
---------
由于升级到5.4后,默认display_error为OFF,所以很多错误 都显示不出来,排查了好久才解决这个问题啊。

Tags: sablog