PHP 5.4 Support: Array Dereferencing

Hi all! As I wrote in my last blog post, this year is the year of PHP 5.4. Last PHP 5.4 RC is comming and stable version should be relased soon, so we would like to introduce you some of our PHP 5.4 editor features.

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).

Today we would like to talk about array dereferencing. If you don't know, what does it mean, you can just read an official RFC.

And here it is. This is how it looks like in NetBeans PHP Editor. No syntax errors and working code completion.

PHP 5.4: Array Dereferencing

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:

PHP 2.43 -> 2.44 get my netbeans crashed.

Posted by guest on January 19, 2012 at 08:32 AM CET #

The only options I see for Netbeans 7.1 are 5.2 and 5.3. How would one get the PHP 5.4 option?

Posted by James on January 28, 2012 at 10:44 PM CET #

It's not a 7.1 feature...it's implemented in 7.2 development version. You should use the link [1] to download the right version of IDE.

[1] http://bits.netbeans.org/download/trunk/nightly/latest/

Posted by Ondrej Brejla on January 30, 2012 at 09:48 AM CET #

workaround for the moment:

class MyClass {

/**
*
* @return array|of|MyClass
*/
public function getArray()
{
return array(new MyClass());
}
}

"@return MyClass" works but "@return array|of|MyClass" is more explicit

Posted by guest on February 07, 2012 at 12:14 PM CET #

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