The drop is always movingYou know that saying about standing on the shoulders of giants? Drupal is standing on a huge pile of midgetsAll content management systems suck, Drupal just happens to suck less.Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]Drupal makes sandwiches happen.There is a module for that

On PHP short array syntax

Submitted by nk on Tue, 2008-06-03 18:35

There is a heated debate on PHP internals list -- this in itself is not news, the list should be called "php heated debate list" btw. -- about short array syntax. What I will write here is probably know to the Drupal readers -- less known to the PHP internals list, I guess. So, I am the form API maintainer of Drupal, which probably is the most complex array based API in existence. I support the $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon']; wholeheartedly. I less like $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon']; but I guess we could be friends with this one too :) Also, could we get named parameters and closures? Please?

Commenting on this Story is closed.

Submitted by on Wed, 2008-06-04 02:46.

My immediate reaction upon seeing this is that the double arrow syntax is more traditionally like PHP and Ruby, while the colon syntax is more like Python and JavaScript.

PHP: $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon') # Makes an associated array
Ruby: b = {'foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'} # Makes a hash
Python: b = {'foo': 'orange', 'bar': 'apple', 'baz': 'lemon'} # Makes a dictionary
JavaScript: var b = {'foo': 'orange', 'bar': 'apple', 'baz': 'lemon'}; // Makes an object

Funny how the four languages all have different names for this.