I've worked with PHP for years, using only procedural programming, writing lots of functions and storing DB records in arrays. Now I want to start working with objects, but I have some perplexities.
Let's suppose that I have to develop a large community, where a single page can require the reading of hundreds of user records from the database. Until now, I stored records in an array of arrays, and I used simple functions to manipulate them: no problems. But now i have the User class, with lots of properties and lots of methods (load, save, edit, delete, get_friends, and so on). So, when I read users from the database, it's obvious to create an array of User objects.
Will the PHP program became too heavy? This method to work with DB and objects can affect performance significatively? I think that instantiate hundreds of objects will be much heavier than create hundreds of associative arrays... What do you think? How do you work with DB and classes? Is my worry vain?
Thank tou all,
Lorenzo.