在PHP中,Array和array在类型声明中有什么区别?

In PHP, what is the difference between Array and array, in type declaration?

this OOP 教程中,我注意到以下代码:

public function validate(Array $data, Array $rules){}

我的问题是这是否与以下内容相同:

public function validate(array $data, array $rules){}

PHP.net documentation中,我只能找到第二种形式的参考。

Javascript 只能使用 "Array"。在PHP中使用"array"是没有问题的,但是如果你想也使用Javascript,它会导致错误。

它们是一样的。不过,有些 IDE 只能识别其中一种形式。 (就像 Whosebug 本身,它只风格化 Array

简短:PHP 函数,user-defined 函数和变量名称与 case-insensitive 相同,但 class 常量除外。