[drupal-devel] multidimensional arrays VS objects. should we go for one?

Gabor Hojtsy gabor at hojtsy.hu
Mon Oct 10 15:55:28 UTC 2005

> IMO the clean way is to have arrays when the data is NOT structured, but is a 
> list of similar items, but to have objects when it is structured. 
> so $menu_item->path instead of $menu_item['path']. just like we have for most 
> 'things' like nodes, comments, terms, etc. But all these $menu_items should 
> sit in a $items array, not in $items->item1, $items->item2.
> Most of this is in place already, but not all. Keeping Drupal clean means 
> deciding on standards like these too, IMO.

Agreead. Structured data vs. list data is a good separation indicator.


More information about the drupal-devel mailing list