有些更新由于没有仔细看,结果就出错了,所以,还是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 anE_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 aE_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 aE_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 anE_WARNING
level error, instead ofE_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:
- define_syslog_variables()
- import_request_variables()
- session_is_registered(), session_register() and session_unregister().
- The aliases mysqli_bind_param(), mysqli_bind_result(), mysqli_client_encoding(), mysqli_fetch(), mysqli_param_count(), mysqli_get_metadata(), mysqli_send_long_data(), mysqli::client_encoding() and mysqli_stmt::stmt().