1. 云栖社区>
  2. PHP教程>
  3. 正文

PHP 7 is coming soon

作者:用户 来源:互联网 时间:2017-12-01 15:41:52

PHP 7 is coming soon - 摘要: 本文讲的是PHP 7 is coming soon, After a few RCs , PHP 7 will be officially released on November 12, 2015. This is a major release of PHP since PHP [em

After a few RCs , PHP 7 will be officially released on November 12, 2015. This is a major release of PHP since PHP [email protected], one of the core contributors of PHP, has posted this news on Weibo(China's Twitter).

PHP 7 is coming soon

This is a one month later than the expected time as recorded in PHP 7 timeline . But it's not that late.

The new release will come with a few features including:

Scalar type declaration, you can define variable like int now Return type support. Besides declare scalar type for variable, you can return typed data from function as well Null coalesce operator(??). It is a syntactic sugar to replace isset() function to check whether a variable is set and is not NULL Spaceship operator(<=>).The spaceship operator is used for comparing two expressions. It returns -1, 0 or 1 when $a is respectively less than, equal to, or greater than $b. Constant arrays using define(). Similar to enum in Java. Anonymous class. Support for anonymous classes has been added via new class . These can be used in place of full class definitions for throwaway objects: Unicode codepoint escape syntax. This takes a Unicode codepoint in hexadecimal form, and outputs that codepoint in UTF-8 to a double-quoted string or a heredoc. Closure::call(). Closure::call() is a more performant, shorthand way of temporarily binding an object scope to a closure and invoking it. Filtered unserialize(). This feature seeks to provide better security when unserializing objects on untrusted data. It prevents possible code injections by enabling the developer to whitelist classes that can be unserialized. IntlChar. The new IntlChar class seeks to expose additional ICU functionality. The class itself defines a number of static methods and constants that can be used to manipulate unicode characters. Expectations. Expectations are a backwards compatible enhancement to the older assert() function. Group use declarations. Classes, functions and constants being imported from the same namespace can now be grouped together in a single use statement. Generator Return Expressions. Generator delegation Integer division with intdiv(). The new intdiv() function performs an integer division of its operands and returns it. New enhancement for sessions.

So just be ready and download and start to use the new PHP 7 in a few days.

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索,以便于您获取更多的相关知识。