Michael Haddad
Michael Haddad

Reputation: 4435

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.

Upvotes: 4

Views: 3336

Answers (3)

David Syengo
David Syengo

Reputation: 29

Short answer: PHP constructs, class names, functions and user-defined functions are case-insensitive.

Upvotes: 0

Luis Ávila
Luis Ávila

Reputation: 699

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

Upvotes: 6

HightronicDesign
HightronicDesign

Reputation: 709

Javascript can only usw "Array". Using "array" in PHP is no problem, but if you want do use Javascript too, it will cause an error.

Upvotes: -5

Related Questions