PHP 5.4 Support: Short Array Syntax

Hi all! Today is the introduction day of our next PHP 5.4 Feature support. It's called Short Array Syntax and will be available in NetBeans 7.2.

Note: All PHP 5.4 features are available in your projects after setting Project Properties -> Sources -> PHP Version to PHP 5.4 value, or after choosing the same value during a PHP Project creation (in New Project Wizard).

Common PHP array declaration syntax is quite long, so developers of PHP decided to support some kind of a shorter syntax. You can use just [ instead of an old long array( prefix and ] instead of a closing bracket ).

Following image shows you how it looks like in NetBeans 7.2.

PHP 5.4: Short Array Syntax

That's all for today and as usual, please test it and if you find something strange, don't hesitate to file a new issue (component php, subcomponent Editor). Thanks.

Comments:

Well done for the work of your team!
I just discovers this blog and it's nice to see your progress!
Sf2, Doctrine2, PHP5.4, ... Netbeans 7.2 will be great!

Posted by webda2l on February 13, 2012 at 05:45 PM CET #

Thanks for your post.It is very useful for me to construct a array in php

Posted by jewel on July 24, 2012 at 08:26 AM CEST #

I create the arrays in PHP using both formats. Possible implemented with macro '[' character calling the array() function

Posted by creative php coder on August 06, 2012 at 07:56 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today