Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复:( 何时)我应该在 PHP 中使用类型提示?
当使用 PHP 编程时,应该尽可能地使用类型提示,还是只是接受并接受 PHP 是一种松散类型的语言?
类型提示将为您提供来自 IDE 的更多帮助,这很好。
如果一个函数在没有给出适当的对象的情况下会/可能崩溃,您最好键入提示,以便及早发现错误并拥有更多的自我文档代码。