PHP基础(001)PHP优势,特性,编码规范,版本Release信息等

PHP语言的优势:

  1. 代码开源;
  2. 跨平台(如Unix/Linux/Macintosh/FreeDSD/Windows7/Win32等);
  3. 支持广泛数据库(如Mysql/Access/SQL Server/Oracle/DB2等);
  4. LAMP(Linux/Apache/MySQL/PHP组合免费使用);
  5. PHP+Apache/Nignx+Mysql+Linux
  6. 模板化(如Smarty模板等);
  7. 支持面向对象和面向过程,并可向下兼容;
  8. 内嵌ZEND加速引擎,性能稳定快速;

PHP 的应用领域:

  1. 中小型网站的开发;
  2. WEB办公管理系统;
  3. 硬件管控软件的GUI;
  4. 电子商务应用;
  5. 多媒体系统开发;
  6. 企业级应用开发;

PHP各版本新特性:

  • PHP 5->
    • 构造函数和析构函数
    • 对象的引用
    • 对象的克隆(clone);
    • 对象中的私有,公共及受保护模式(public/private/protected);
    • 接口(interface);
    • 抽象类
    • __call;
    • __set和__get;
    • 静态成员
  • PHP 6->
    • 待补?
PHP编码规范:(大体上保持与C#相同)
  • PHP
    • 采用名称命名法,如GetValue();
    • 以PascalCasing形式来命名:
      • 类名/函数名/ ---自定义
    • 以camelCasing形式命名:
      • 变量/属性/
    • 以小写命名:
      • 关键字,如function/class/define/interface...
      • 内置函数名,如rand(),preg_match(),
      • 标签名,如<php>,...
    • 以大写命名:
      • 常量名/SQL语句中的关键字/系统变量,如E_ERROR,PHP_VERSION,$_SERVER['SERVER_PORT'],SELECT,UPDATE...
    •  
  • HTML
    • 首字母大写:
    • 以小写命名:
      • 标签名,如<html>,body,head...
      • 关键字,
    •   
 
 
PHP 支持八种原始类型:
  • 四种标量类型:boolean(布尔型) integer(整型) float(浮点型,也作“double”) string(字符串)
  • 两种复合类型:array(数组)object(对象)
  • 最后是两种特殊类型:resource(资源)NULL

 PHP版本信息:

PHP版本号5.3.4,  设x.y.z
x版本号变化是结构改变
y版本号变动是功能增加
z版本号变动都是修正漏洞

5.0,zend2引擎,对象模型变化
5.1, 增加PDO数据库操作类,
5.2 内置JSON,开启滤镜
5.3 增加名字空间、延迟动态绑定、goto无条件跳转、改进win下效率,支持sqlite3等等
5.4 增加trait特征组语法,增加内置网站服务器。废除不少旧环境参数

PHP版本Release信息:=》

PHP 5.5.0 Release Announcement

20-Jun-2013

The PHP development team is proud to announce the immediate availability of PHP 5.5.0. This release includes a large number of new features and bug fixes.

The key features of PHP 5.5.0 include:

  • Added generators and coroutines.
  • Added the finally keyword.
  • Added a simplified password hashing API.
  • Added support for constant array/string dereferencing.
  • Added scalar class name resolution via ::class.
  • Added support for using empty() on the result of function calls and other expressions.
  • Added support for non-scalar Iterator keys in foreach.
  • Added support for list() constructs in foreach statements.
  • Added the Zend OPcache extension for opcode caching.
  • The GD library has been upgraded to version 2.1 adding new functions and improving existing functionality.
  • A lot more improvements and fixes.

Changes that affect compatibility:

  • PHP logo GUIDs have been removed.
  • Windows XP and 2003 support dropped.
  • Case insensitivity is no longer locale specific. All case insensitive matching for function, class and constant names is now performed in a locale independent manner according to ASCII rules.

For users upgrading from PHP 5.4, a migration guide is available detailing the changes between 5.4 and 5.5.0.

For a full list of changes in PHP 5.5.0, see the ChangeLog.

PHP 5.4.0 Release Announcement

1-Mar-2012

 

The PHP development team is proud to announce the immediate availability of PHP 5.4.0. This release is a major leap forward in the 5.x series, which includes a large number of new features and bug fixes.

The key features of PHP 5.4.0 include:

  • New language syntax including Traits, shortened array syntax and more
  • Improved performance and reduced memory consumption
  • Support for multibyte languages now available in all builds of PHP at the flip of a runtime switch
  • Built-in webserver in CLI mode to simplify development workflows and testing
  • Cleaner code base thanks to the removal of multiple deprecated language features
  • Many more improvements and fixes

Changes that affect compatibility:

  • Register globals, magic quotes and safe mode were removed
  • The break/continue $var syntax was removed
  • The ini option allow_call_time_pass_reference was removed
  • The PHP default_charset is now "UTF-8"

Extensions moved to PECL:

  • ext/sqlite (ext/sqlite3 and ext/pdo_sqlite are not affected)

PHP 5.4 series will be the last versions to support Windows XP and Windows 2003. We will not provide binary packages for these Windows versions anymore after PHP 5.4.

For users upgrading from PHP 5.3 there is a migration guide available here, detailing the changes between those releases and PHP 5.4.0.

For a full list of changes in PHP 5.4.0, see the ChangeLog.

PHP 5.3.6 Released!

[17-Mar-2011]

 

The PHP development team would like to announce the immediate availability of PHP 5.3.6. This release focuses on improving the stability of the PHP 5.3.x branch with over 60 bug fixes, some of which are security related.

Security Enhancements and Fixes in PHP 5.3.6:

  • Enforce security in the fastcgi protocol parsing with fpm SAPI.
  • Fixed bug #54247 (format-string vulnerability on Phar). (CVE-2011-1153)
  • Fixed bug #54193 (Integer overflow in shmop_read()). (CVE-2011-1092)
  • Fixed bug #54055 (buffer overrun with high values for precision ini setting).
  • Fixed bug #54002 (crash on crafted tag in exif). (CVE-2011-0708)
  • Fixed bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive). (CVE-2011-0421)

Key enhancements in PHP 5.3.6 include:

  • Upgraded bundled Sqlite3 to version 3.7.4.
  • Upgraded bundled PCRE to version 8.11.
  • Added ability to connect to HTTPS sites through proxy with basic authentication using stream_context/http/header/Proxy-Authorization.
  • Added options to debug backtrace functions.
  • Changed default value of ini directive serialize_precision from 100 to 17.
  • Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error).
  • Fixed Bug #53958 (Closures can't 'use' shared variables by value and by reference).
  • Fixed bug #53577 (Regression introduced in 5.3.4 in open_basedir with a trailing forward slash).
  • Over 60 other bug fixes.

Windows users: please mind that we do no longer provide builds created with Visual Studio C++ 6. It is impossible to maintain a high quality and safe build of PHP for Windows using this unmaintained compiler.

For Apache SAPIs (php5_apache2_2.dll), be sure that you use a Visual Studio C++ 9 version of Apache. We recommend the Apache builds as provided by ApacheLounge. For any other SAPI (CLI, FastCGI via mod_fcgi, FastCGI with IIS or other FastCGI capable server), everything works as before. Third party extension providers must rebuild their extensions to make them compatible and loadable with the Visual Studio C++9 builds that we now provide.

All PHP users should note that the PHP 5.2 series is NOT supported anymore. All users are strongly encouraged to upgrade to PHP 5.3.6.

For a full list of changes in PHP 5.3.6, see the ChangeLog. For source and binaries downloads please visit our downloads page.

PHP 5.3.2 released

04-Mar-2010

 

The PHP development team is proud to announce the immediate release of PHP 5.3.2. This is a maintenance release in the 5.3 series, which includes a large number of bug fixes.

Security Enhancements and Fixes in PHP 5.3.2:

  • Improved LCG entropy. (Rasmus, Samy Kamkar)
  • Fixed safe_mode validation inside tempnam() when the directory path does not end with a /). (Martin Jansen)
  • Fixed a possible open_basedir/safe_mode bypass in the session extension identified by Grzegorz Stachowiak. (Ilia)

Key Bug Fixes in PHP 5.3.2 include:

  • Added support for SHA-256 and SHA-512 to php's crypt.
  • Added protection for $_SESSION from interrupt corruption and improved "session.save_path" check.
  • Fixed bug #51059 (crypt crashes when invalid salt are given).
  • Fixed bug #50940 Custom content-length set incorrectly in Apache sapis.
  • Fixed bug #50847 (strip_tags() removes all tags greater then 1023 bytes long).
  • Fixed bug #50723 (Bug in garbage collector causes crash).
  • Fixed bug #50661 (DOMDocument::loadXML does not allow UTF-16).
  • Fixed bug #50632 (filter_input() does not return default value if the variable does not exist).
  • Fixed bug #50540 (Crash while running ldap_next_reference test cases).
  • Fixed bug #49851 (http wrapper breaks on 1024 char long headers).
  • Over 60 other bug fixes.

The SNMP extension is now available in VC9 versions. The cURL and MPIR libraries have been updated.

For users upgrading from PHP 5.2 there is a migration guide available here, detailing the changes between those releases and PHP 5.3.

Further information and downloads:

For a full list of changes in PHP 5.3.2, see the ChangeLog. For source downloads please visit our downloads page, Windows binaries can be found on windows.php.net/download/.

PHP 5.2.13 released

25-Feb-2010

 

The PHP development team would like to announce the immediate availability of PHP 5.2.13. This release focuses on improving the stability of the PHP 5.2.x branch with over 40 bug fixes, some of which are security related. All users of PHP 5.2 are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.2.13:

  • Fixed safe_mode validation inside tempnam() when the directory path does not end with a /). (Martin Jansen)
  • Fixed a possible open_basedir/safe_mode bypass in session extension identified by Grzegorz Stachowiak. (Ilia)
  • Improved LCG entropy. (Rasmus, Samy Kamkar)

Further details about the PHP 5.2.13 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

The libcURL library has been updated to 7.20.0, which fixes important bugs fixes as well as a security flaw, see the advisory here and the full changelog here.

PHP 5.3.1 released

19-Nov-2009

 

The PHP development team would like to announce the immediate availability of PHP 5.3.1. This release focuses on improving the stability of the PHP 5.3.x branch with over 100 bug fixes, some of which are security related. All users of PHP are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.3.1:

  • Added "max_file_uploads" INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion.
  • Added missing sanity checks around exif processing.
  • Fixed a safe_mode bypass in tempnam().
  • Fixed a open_basedir bypass in posix_mkfifo().
  • Fixed failing safe_mode_include_dir.

Further details about the PHP 5.3.1 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

The OpenSSL library has been updated to 0.9.8l, which fixes important bugs fixes (see the OpenSSL website for details.

PHP 5.2.11 released

17-Sept-2009

 

The PHP development team would like to announce the immediate availability of PHP 5.2.11. This release focuses on improving the stability of the PHP 5.2.x branch with over 75 bug fixes, some of which are security related. All users of PHP 5.2 are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.2.11:

  • Fixed certificate validation inside php_openssl_apply_verification_policy. (Ryan Sleevi, Ilia)
  • Fixed sanity check for the color index in imagecolortransparent(). (Pierre)
  • Added missing sanity checks around exif processing. (Ilia)
  • Fixed bug #44683 (popen crashes when an invalid mode is passed). (Pierre)

Key enhancements in PHP 5.2.11 include:

  • Fixed regression in cURL extension that prevented flush of data to output defined as a file handle.
  • A number of fixes for the FILTER_VALIDATE_EMAIL validation rule
  • Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
  • Fixed bug #48696 (ldap_read() segfaults with invalid parameters)
  • Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities).
  • Fixed bug #48619 (imap_search ALL segfaults).
  • Fixed bug #48400 (imap crashes when closing stream opened with OP_PROTOTYPE flag).
  • Fixed bug #47351 (Memory leak in DateTime).
  • Over 60 other bug fixes.

On windows, the cURL library has been updated to its latest version (7.19.6) to fix the flaws described here.

Further details about the PHP 5.2.11 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

PHP 5.3.0 released

30-Jun-2009

 

The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes.

Some of the key new features include: namespaces, late static binding, closures, optional garbage collection for cyclic references, new extensions (like ext/phar, ext/intl and ext/fileinfo), over 140 bug fixes and much more.

For users upgrading from PHP 5.2 there is a migration guide available here, detailing the changes between those releases and PHP 5.3.0.

Further details about the PHP 5.3.0 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

PHP 5.2.10 released

18-Jun-2009

 

The PHP development team would like to announce the immediate availability of PHP 5.2.10. This release focuses on improving the stability of the PHP 5.2.x branch with over 100 bug fixes, one of which is security related. All users of PHP are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.2.10:

  • Fixed bug #48378 (exif_read_data() segfaults on certain corrupted .jpeg files). (Pierre)

Further details about the PHP 5.2.10 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.

PHP 5.2.9-2 (Windows) released

07-Apr-2009

 

The PHP Development Team would like to announce the availability of a new Windows build for PHP - PHP 5.2.9-2

This release focuses on fixing security flaws in the included OpenSSL library (CVE-2009-0590, CVE-2009-0591 and CVE-2009-0789). The security advisory is available here.

The OpenSSL library has been updated to 0.9.8k, which includes fixes for these flaws.

Note: Only the Windows binaries are affected. There are no changes to the PHP sources, therefore no source releases are necessary.

Binaries are available in our downloads page

PHP 5.2.9-1 (Windows) released

10-Mar-2009

 

The PHP Development Team would like to announce the availability of a new Windows build of PHP - PHP 5.2.9-1

This release focuses on fixing a security flaw introduced by the cURL library (CVE-2009-0037). Please see the following for a full description: http://curl.haxx.se/docs/adv_20090303.html

Please note that the cURL related function is disabled when open_basedir or safe_mode enabled.

Note: Only the Windows packages are affected.

Binaries are available in our downloads page

PHP 5.2.9 released

26-Feb-2009

 

PHP 5.2.9 is now available. Get it here.

The OpenSSL library has been updated to its latest version, 0.9.8j

This release has been the occasion to greatly improve the installer, it should now work smoothly on every supported platform.

For the full list of changes, see the announcement .

PHP 5.2.9RC3 released

19-Feb-2009

 

PHP 5.2.9RC3 is now available for testing. Get it here.

Installer and non thread safe builds available for the snapshots

23-Oct-2008

 

PHP ChangeLoghttp://php.net/ChangeLog-5.php#5.5.0

 

posted on 2014-04-26 16:28  lbsf  阅读(211)  评论(0编辑  收藏  举报

导航