虽然async和await这两个特性现在还不可用,但是在过去的几年里,PHP语言本身已经有了很多改进。下面是一个非详尽的PHP新特性列表:
1、短闭包(Short closures):https://stitcher.io/blog/short-closures-in-php
2、合并运算符:https://stitcher.io/blog/shorthand-comparisons-in-php#-coalescing-operator
3、Traits(注:一种为PHP这样的单继承语言而设计准备的代码复用机制):https://www.php.net/manual/en/language.oop5.traits.php
4、属性类型化(Typed properties):https://stitcher.io/blog/new-in-php-74#typed-properties-rfc
5、扩展运算符(Spread operator):https://wiki.php.net/rfc/argument_unpacking
6、即时编译器(JIT compiler):https://wiki.php.net/rfc/jit
7、外部函数接口(FFI):https://wiki.php.net/rfc/ffi
8、匿名类:https://www.php.net/manual/en/language.oop5.anonymous.php
9、声明返回类型:https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration
10、现代加密库:https://wiki.php.net/rfc/libsodium
11、生成器:https://wiki.php.net/rfc/generators
12、很多其它特性:https://www.php.net/ChangeLog-7.php