phparraystype-declaration

What is the difference between Array and array?


In this OOP tutorial, I noticed the following code:

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

My question is if that is the same as:

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

In the PHP.net documentation, I could find a reference only to the second form.


Solution

  • They are both the same. Some IDEs only recognize one of the forms, though. (Just like stackoverflow itself, which only stylizes Array