News for hackers. Stuff that matters.
Re:Short array syntax finally in PHP 5.4 by harisenbon on Monday July 25, 2011 @12:21AM (#2801330)
While I would love them to bring the array functions more into line with other OO langauges, the entire language is not structured around that concept, so you would be in essence writing a whole new language.

Because almost all the modern PHP frameworks use arrays to pass data, the short-array syntax makes viewing multi-dimensional arrays much easier, and thus will hopefully result in less bugs.

Example:

  $this->link('My Link', array('names'=> array('a', 'b', 'c'), 'values'=> array('a1', 'a2', 'a3') ) );
becomes:

  $this->link('My Link', ['names'=> ['a', 'b', 'c'], 'values'=> ['a1', 'a2', 'a3'] ]);
Just removing the word array makes the code much easier to read, especially when you have deeply nested arrays.
Re:Short array syntax finally in PHP 5.4 by gdulli on Monday July 25, 2011 @08:58AM (#2802396)
"so you would be in essence writing a whole new language"

After having to use PHP for a while, it's no coincidence that these days I am using a whole new language.