-1

What is the difference between declaring:

$myArray = Array();

and:

$myArray = [];
2
  • pretty sure $myArray = new Array(); is not php Commented Jun 17, 2021 at 22:09
  • Question edited, sorry! Commented Jun 17, 2021 at 22:10

1 Answer 1

1

There's no difference, it's just two alternative syntaxes. See https://www.php.net/manual/en/language.types.array.php

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.