Shorter Syntax of Array Declaration in PHP 5.4

With every release of PHP new version, new functionality,improvement and bug fixes are released. PHP 5.4 introduces the concept of Generators and traits etc. Apart from new functionality, PHP 5.4 introduces many improvements one such improvement is shorter syntax of array declaration.

Till PHP 5.3 an array can be created using array() language construct.

Top Five Most Used PHP Array Functions

Subscribe Our Tutorials

Get Latest Updates on Facebook

Array Declaration in PHP 5.4

In PHP 5.4, same can be written as

Javascript uses the same syntax for array declaration.

You can still use the old method of array declaration in new version of PHP. It’s an alternate syntax of declaring an array.

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged , , , . Bookmark the permalink.