Hi, Op dinsdag 9 januari 2007 22:57, schreef Doug Green:
To use objects or arrays? What is the "Drupal way"? I'd rather write code using objects (php's stdClass). But I've run into a ton of problems using objects on php4.
My general advice is: use what suits best at that moment, but lean as much as posible towards arrays. The reason is that Drupal is moving away from objects, slowly: Some gnomes in Drupal Core have been working very hard at replacing objects for arrays last two releases. They even invented a syntax that allows arrays to look and act a little like objects array('#foo' => $bar). The reasons people chose this are both religious and pragmatic, and it is a can of worms as you can see on other branches of this thread :) So, this seems to be, or else become, the "Drupal way". Bèr -- Drupal, Ruby on Rails and Joomla! development: webschuur.com | Drupal hosting: www.sympal.nl