新特性
1.變量類型
function test(int $a,string $b,array $c):int{
//code
}
2.錯誤異常
可以用try/catch捕捉錯誤
try{
non_exists_func();
}catch(EngineException $e){
echo ...錯誤
}
性能優(yōu)化
1.zval使用棧內(nèi)存
2.zend_string存儲hash值,array查詢不再需要重復(fù)計(jì) 算hash
3.hashtable桶內(nèi)直接存數(shù)據(jù),減少了內(nèi)存申請次數(shù), 提升了Cache命中率和內(nèi)存訪問速度
4.zend_parse_parameters改為宏實(shí)現(xiàn),性能提升5%
5.新增加4種OPCODE, call_user_function,is_int/string/array,strlen,de fined 4個函數(shù)變?yōu)镻HP OpCode指令,速度更快
6.基礎(chǔ)類型int、float、bool等改為直接進(jìn)行值拷貝, 排序算法改進(jìn),PCRE with JIT,execute_data和opline 使用全局寄存器,使用gdb4.8的PGO功能
JIT
just in time,表示運(yùn)行時將指令轉(zhuǎn)為二進(jìn)制機(jī)器碼
PHP7.0沒有JIT