Declaring arrays with square brackets in PHP

Version 5.4 of PHP brings many useful new features, including the declaration of arrays in square brackets. Many developers will love this innovation, especially those who are used to short syntax.
Old syntax for declaring arrays:
$ array = array ();
New syntax for declaring arrays:
$ array = [];
It's up to you to use the short syntax or not when developing your projects, but the new syntax is more convenient.
Comments (0)
For commenting sign in or register.
Latest articles
- IT / Misc 08.07.21 How to make a free translation for a website without an API, translate documents in Google Translate
- IT / Misc 06.07.21 How to make a subscription button on a website, a subscriber base and automatic mailing
- Food / Misc 06.07.21 How to quickly cook delicious fried pies with potatoes and onions
- IT / Misc 04.07.21 Caching - create, load and reset. Where to store the cache, methods and types of caching
- IT / Database 03.07.21 Custom NoSQL - storing data in files and not only in a database. Storing settings, small data and caching files