Sign in Registration

Declaring arrays with square brackets in PHP

Объявление массивов квадратными скобками в 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

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to



IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.