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
- 03.04.24IT / Уроки PHP Уроки простыми словами. Урок 3. Все операторы PHP с примерами, с выводом работы кода на экран.
- 02.04.24IT / Уроки PHP Уроки простыми словами. Урок 2. Типы данных в PHP с примерами.
- 02.04.24IT / Уроки PHP Уроки простыми словами. Урок 1. Коротко о языке веб-программирования PHP. Основы синтаксиса.
- 09.11.23IT / Database Errors when migrating from MySQL 5.6 to 5.7 and how to fix them - database dump import failed with an error or INSERT does not work. Disabling STRICT_TRANS_TABLES strict mode or using IGNORE
- 08.07.22IT / Misc Convert office files DOC, DOCX, DOCM, RTF to DOCX, DOCM, DOC, RTF, PDF, HTML, XML, TXT formats without loss and markup changes