2015-12-04
全球82%網頁載入速度可翻倍提升
十年磨一劍 最新 PHP 7 正式版本登場
文: Samuel Wong / 新聞中心
文章索引: IT要聞 其它

The PHP Group 3 日終於發佈最新 PHP 7.0.0 ,相對上代 PHP 5 發佈日期已事隔超過十年,新版本 PHP 7.0.0 據官方指相對上代效能翻倍提升,更提供 12 項新特色功能給開發者。

 

PHP 受到全球廣泛性使用的 Web 開發語言,據市調公司數據指出其市佔率高達 82% ,代表大部份用家觀看的網頁亦是採用 PHP 語言編寫。最新 PHP 7.0.0 效能跳躍式提升,據官方表示效能相對 PHP 5.6 版有著 2 倍的效能提升,大幅減低網頁的載入時間。

 

同時, PHP 7.0.0 減低記憶體及處理器的使用,據了解,以執行 WordPess 100 次為測試, PHP 5.6 會產生 70 億次 CPU 指令,但 PHP 7 只會產生 25 億次 CPU 指令,效能驚人。另外, Just In Time  (JIT) 優化技術,實現 JTT 技術後新舊版本 PHP 的速度能達到 8 倍的差別。

 

此外, PHP 7 加入 Abstract Syntax Tree (AST) 於解釋過程中,由原本的 PHP 代碼 >Parser( 語法詞法解析 )>Opcode ( 中間字節碼 > 執行, PHP 7 於 Parser 後加入 AST ,從而減少 HACK 代碼,更易詮釋及維護度更高。

 

其他更新包括: Consistent 64-bit support 、 Improved Exception hierarchy 、 Many fatal errors converted to Exceptions 、 Secure random number generator 、 Removed old and unsupported SAPIs and extensions 、 The null coalescing operator (??) 、 Return and Scalar Type Declarations 、 Anonymous Classes 及 Zero cost asserts 。

 

PHP 官網

 

PHP

 

發表評論