php7 新特性

<=> 太空船操作符 用于表达两个表达式

类型声明

null合并操作符 ??

常量数组 define('arr',[1,2,3,4])

namespace 批量导入 use Space\{ClassA,ClassB,ClassC as C};

try catch 捕获空错误类型。还有set_exception_handler捕获。比如未命名函数。

<?php

try{
	undefindfunc();
}catch(Error $e){
	var_dump($e);
}
<?php

set_exception_handler(function($e){
	var_dump($e);
});

Closure::call 方法

intdiv 两数相除取整

list方括号写法 $arr = [1,2,3,4];

抽象语法树ast

php7 新特性

更多请看https://www.runoob.com/php/php7-new-features.html

原创文章,作者:星辰,如若转载,请注明出处:https://www.z88j.com/189.html

(7)
打赏 微信扫一扫 微信扫一扫
上一篇 2021年3月14日 下午7:29
下一篇 2021年3月15日 上午11:54

相关推荐

发表回复

登录后才能评论

Warning: error_log(/www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/#log/log-2701.txt): failed to open stream: No such file or directory in /www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/spider.class.php on line 2900