Short array syntax [] was introduced a while back when PHP 5.4 was released. Basically it is ability to define arrays using [] instead of array().

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php 

$arr1 = array(
	'motto' => 'learning is fun.',
	'url'   => 'raisachin.com.np'
);

$arr2 = [
	'motto' => 'learning is fun.',
	'url'   => 'raisachin.com.np'
];

echo '<pre>'; 
print_r($arr1); 
echo '</pre>';

Using any of the above will result the same output.

WordPress prefer array() instead of short array syntax , because it can run on PHP 5.2 , and [] was not introduced back then. Using short array syntax can breaks some sites running on wordpress.

Happy Coding 😍