[drupal-devel] Why the object notation?

Karoly Negyesi karoly at negyesi.net
Thu Jul 28 05:17:28 UTC 2005


Drupal code uses object notation very often and I fail to see why it's 
better than associative arrays. We get $_POST data in arrays so we need to 
convert back and forth. 

We never use the class construct. So why the -> ?

It seems like the change can be done with at most two simple regexp 



Ps. I think it's OK to initialize an array by $array['foo'] = 'bar'; this 
needs two steps with object notation. Only $array[] needs initialization.

More information about the drupal-devel mailing list