-5

I want to know if there is a difference, and what is the difference between declaring a variable as [] and as array()

i.e

Difference between $p=[] and $p=array()

Skumar
  • 480
  • 6
  • 24

1 Answers1

4

The difference being the array() is for versions 5.4 and below, whereas [] can be used in versions 5.4 and above. The [] array is quicker than using array() as well.

justicexvx
  • 41
  • 4