【发布时间】:2019-10-10 11:56:10
【问题描述】:
在探索一些laravel包的代码时,我通常会在类中看到这种类型的函数,我想知道这种类型的函数的名称是什么以及如何使用它,例如:
protected function getFiles(): Filesystem
{
}
或
protected function getConfigPath(): string
{
}
PHP 文档链接会很有用。
【问题讨论】:
-
Return type declarations 添加了 PHP 7。
-
@Dharman,完成!