说我有这个
function foo(){
return [1, 'bippo'];
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能编写它在自动完成时自动创建的 phpdoc 像这样
list($x, $y) = foo();
Run Code Online (Sandbox Code Playgroud)
Jel*_*rgu -5
如phpDocumentor: Defining a 'Type' section Array中所述,您可以将包含多种类型的数组指定为@return (int|string)[],这意味着该函数的返回类型是一个数组,可以包含以下类型的元素int:string