美文网首页
PHP各版本特性

PHP各版本特性

作者: 倾斜的阳光 | 来源:发表于2017-12-20 18:42 被阅读0次

链接

PHP5.3

PHP5.4

PHP5.5

PHP5.6

PHP7.0

PHP7.1

PHP7.2

PHP 5.3.0 offers a wide range of new features:

  • Support for namespaces has been added.
  • Support for Late Static Bindings has been added.
  • Support for jump labels (limited goto) has been added.
  • Support for native Closures (Lambda/Anonymous functions) has been added.
  • There are two new magic methods, __callStatic() and __invoke().
    Nowdoc syntax is now supported, similar to Heredoc syntax, but with single quotes.
  • It is now possible to use Heredocs to initialize static variables and class properties/constants.
  • Heredocs may now be declared using double quotes, complementing the Nowdoc syntax.
  • Constants can now be declared outside a class using the const keyword.
  • The ternary operator now has a shorthand form: ?:.
  • The HTTP stream wrapper now considers all status codes from 200 to 399 to be successful.
  • Dynamic access to static methods is now possible:

PHP 5.4.0 offers a wide range of new features:

  • Support for traits has been added.
  • Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];.
  • Function array dereferencing has been added, e.g. foo()[0].
  • Closures now support $this.
  • <?= is now always available, regardless of the short_open_tag php.ini option.
  • Class member access on instantiation has been added, e.g. (new Foo)->bar().
  • Class::{expr}() syntax is now supported.
  • Binary number format has been added, e.g. 0b001001101.
  • Improved parse error messages and improved incompatible arguments warnings.
  • The session extension can now track the upload progress of files.
  • Built-in development web server in CLI mode.

PHP 5.5.0 offers a wide range of new features:

  • Generators added
  • finally keyword added
  • New password hashing API
  • foreach now supports list()
  • empty() supports arbitrary expressions
  • array and string literal dereferencing
  • Class name resolution via ::class
  • OPcache extension added
  • foreach now supports non-scalar keys
  • Apache 2.4 handler supported on Windows
  • Improvements to GD

PHP 5.6.0 offers a wide range of new features:

  • Constant expressions
  • Variadic functions via ...
  • Argument unpacking via ...
  • Exponentiation via **
  • use function and use const
  • phpdbg
  • Default character encoding
  • Large file uploads
  • GMP supports operator overloading
  • hash_equals() for timing attack safe string comparison
  • __debugInfo()
  • gost-crypto hash algorithm
  • SSL/TLS improvements
  • pgsql async support

PHP 7.0.0 offers a wide range of new features:

  • Scalar type declarations
  • Return type declarations
  • Null coalescing operator
  • Spaceship operator
  • Constant arrays using define()
  • Anonymous classes
  • Unicode codepoint escape syntax
  • Closure::call()
  • Filtered unserialize()
  • IntlChar
  • Expectations
  • Group use declarations
  • Generator delegation
  • Integer division with intdiv()
  • Session options
  • preg_replace_callback_array()
  • CSPRNG Functions
  • list() can always unpack objects implementing ArrayAccess
  • Class member access on cloning has been added, e.g. (clone $foo)->bar().

PHP 7.1.0 offers a wide range of new features:

  • Nullable types
  • Void functions
  • Symmetric array destructuring
  • Class constant visibility
  • iterable pseudo-type
  • Multi catch exception handling
  • Support for keys in list()
  • Support for negative string offsets
  • Support for AEAD in ext/openssl
  • Convert callables to Closures with Closure::fromCallable()
  • Asynchronous signal handling
  • HTTP/2 server push support in ext/curl

PHP 7.2.0 offers a wide range of new features:

  • New object type
  • Extension loading by name
  • Abstract method overriding
  • Sodium is now a core extension
  • Password hashing with Argon2
  • Extended string types for PDO
  • Additional emulated prepares debugging information for PDO
  • Support for extended operations in LDAP
  • Address Information additions to the Sockets extension
  • Parameter type widening
  • Allow a trailing comma for grouped namespaces
  • proc_nice() support on Windows
  • pack() and unpack() endian support
  • Enhancements to the EXIF extension
  • New features in PCRE
  • SQLite3 allows writing BLOBs
  • Oracle OCI8 Transparent Application Failover Callbacks
  • Enhancements to the ZIP extension

相关文章

  • php版本特性

    [doc] 一、PHP 7 新特性 1.1标量类型声明 标量类型声明有两种模式: 强制 (默认) 和 严格模式强制...

  • PHP7上安装PostgreSQL 扩展包

    yum上的各PHP版本扩展包 atomic-php54-php-pgsql.x86_64atomic-php55-...

  • PHP各版本特性

    链接 PHP5.3PHP5.4PHP5.5PHP5.6PHP7.0PHP7.1PHP7.2 PHP 5.3.0 o...

  • PHP各版本特性

    PHP7访问[ http://www.jianshu.com/p/68ff919df337 ]查看 PHP5.6 ...

  • php版本特性学习

    5.6->7.0变更新特性 强制标量声明:文件顶部添加(declare(ticks=1);),变量添加类型声明 返...

  • ThinkPHP 5.0 (一)主要特性 和 命名规范

    一、主要特性 ThinkPHP5.0 版本是一个颠覆和重构版本,采用全新的架构思想,引入了更多的PHP新特性,优化...

  • PHP基础与案例开发详解

    《PHP基础与案例开发详解》本书以目前PHP的较新版本PHP为依托,结合PHP语言特性和实战案例,充分融入了企业开...

  • 2、PHP各版本特性

    源文来自https://github.com/TIGERB/easy-tips,分享给大家 共同进步 PHP 5....

  • PHP 版本新特性总结

    闲来无事,就想着总结一下各个版本特性。然后就有下面的文档 PHP 5.6 新特性 使用表达定义常量 在之前的版本里...

  • PHP 7.4.0 发布

    PHP 7.4.0 发布了,此版本标志着 PHP 7 系列的第四次特性更新。PHP 7.4.0 进行了许多改进,并...

网友评论

      本文标题:PHP各版本特性

      本文链接:https://www.haomeiwen.com/subject/gvhnwxtx.html