-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()

3

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.