PHP支持variadicfunctions的展开语法.在JavaScript中,您可以使用扩展语法来执行this:vara=[1,2];varb=[...a,3,4];console.log(b);//[1,2,3,4]但是,尝试在PHP中执行此操作:$a=[1,2];$b=[...$a,3,4];var_dump($b);die;导致此错误:Parseerror:syntaxerror,unexpected'...'(T_ELLIPSIS),expecting']'在PHP中不允许以这种方式使用扩展语法吗?如果是这样,是否有一种同样优雅的方式来达到同样的效果?
我收到警告消息“直到版本2.2.2才支持for、if和spread元素,但需要此代码才能在早期版本上运行”但代码Column(crossAxisAlignment:CrossAxisAlignment.start,children:[if(document['propertyid']=='1')Text('jjj'),GestureDetector(onTap:(){Navigator.push(context,MaterialPageRoute(builder:(context)=>PropertyDetails(document['propertyid'])));},child:T