Q:

array declarations in php, pros and cons

So far I have not found any direct explanation. I found out two ways of declaring array. I am basically used to
$myArray = array();

I however found out another way which is:
$myArray = [];

why would anyone use the second option over the first. Is there any difference in terms of memory allocated?

A:

The first example array() is the way of declaring array until PHP 5.3 after PHP 5.4 the new shorthand way came which is []
There is no such pros and cons using either as per my knowledge of language. The second way provides you with the shorthand method instead of using full version which can be sometimes time consuming and irritating when used for nested array structure...

