PHP 7.4 有哪些新特性
ParentType {} class ChildType extends ParentType {} class A { public function covariantReturnTypes(): ParentType { /* … */ } } class B extends A { public function covariantReturnTypes(): ChildType { /* … */ } } 简写三元运算符 在目前> PHP 7以后的写法: $data['date'] = $data['date'] ?? new DateTime(); 在PHP 7.4你可以这样写: $data['date'] ??= new DateTime(); 数组展开运算 合并数组到另一个数组中,返回一维数...阅读全文