雖然async和await這兩個特性現(xiàn)在還不可用,但是在過去的幾年里,PHP語言本身已經(jīng)有了很多改進。下面是一個非詳盡的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這樣的單繼承語言而設(shè)計準(zhǔn)備的代碼復(fù)用機制):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、外部函數(shù)接口(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、現(xiàn)代加密庫:https://wiki.php.net/rfc/libsodium
11、生成器:https://wiki.php.net/rfc/generators
12、很多其它特性:https://www.php.net/ChangeLog-7.php