28 Jul
2005
28 Jul
'05
3:08 p.m.
I perfer the object notation because it (when using double quotes) makes string manipulations easier, and easier to read: "Title: <h2>$node->title</h2>" vs. 'Title: <h2>' . $node['title'] . '</h2>' On 7/28/05, Karoly Negyesi <karoly@negyesi.net> wrote:
Hi!
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 replaces.
Regards
NK
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.