首頁  >  文章  >  後端開發  >  PHP540版ChangeLog詳解(上)

PHP540版ChangeLog詳解(上)

WBOY
WBOY原創
2016-08-08 09:23:061120瀏覽

前言

隨著大量的 框架使用composer和namespace,漸漸的線上環境也從之前的5.3變成了5.4或者5.5甚至5.6,隨著7月份PHP7的發布,會有更多的公司採用新版本。

之前好久就想寫這樣的一片文章,來說明下各個版本的差異,這次算是拿出時間了。

這次的是第一篇,目前規劃寫三篇

  • PHP5.4.0
  • PHP5.5.0
  • PHP5.6.0

一方面是對自己的知識的方面,一方面是對自己的組織一次提升。

官方說明

官方文檔地址http://php.net/ChangeLog-5.php#5.4.0

詳細說明

01 Mar 2012

  • required) for generating the configure script with ./buildconf. Autoconf 2.60+ is desirable otherwise the configure help order may be incorrect.

翻譯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.
  • register_globals and register_long_arrays ini options.
  • register_pid_remdal_c還_.
  • 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(3). 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 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.
  • 安全模式和所有相關的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的版本之後,就去除了這個特性。
  • <code><span>break</span><span>$c</span>;
    <span>continue</span><span>$c</span>;</code>
  • break and continue accepts a number, that specify the number of nested loops, that should be breaked up, or continued.

參考。 what-is-the-break-continue-var-syntax-will-be-removed-in-php-5-4

http://php.net/control-structures.break

Safe mode and all related ini options. 移除安全模式以及在設定檔的選項

PHP 的安全模式是為了試圖解決共享伺服器(shared-server)安全問題而設立的。在結構上,試圖在 PHP 層上解決這個問題是不合理的,但修改 web 伺服器層和作業系統層顯得非常不切實際。因此許多人,特別是 ISP,目前使用安全模式。

語言的發展是在不斷的進步的啊,也是一個不斷試誤改錯的過程。 ^_^

保全措施和安全模式,也就是移除了php.ini中所有safe_mode相關的配置項

被安全模式限製或屏蔽的函數 。 在安全限制模式下,有些函數不能被使用。這個限制也會被移除

  • 參考資料
http://php.net/manual/zh/features.safe-mode.php

register_globals and safe-mode.php

register_globals and safe-mode.rem
  • 這兩個配置項因為效能關係被移除了。

    參考資料

    • http://php.net/manual/zh/ini.core.php#ini.register-globals

    import_request_variables()

    導入全域作用域

    bool import_request_variables ( string [,st ring 以上就介紹了PHP540版ChangeLog詳解(上),包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn