Does anyone else have a problem with using objects more than a few times? I have found that certain objects I have created cannot be used more than a few times reliably, especially ones that deal with mysql. The objects retrieve data in simple enough loop, but it seems that it loses data over time. I have checked my server for memory leaks, but it seems to be the PHP/Zend engine that is having trouble keeping up with property changes and method usage in my objects. To workaround this I've had to create new instances of the same object to complete any operations I've had. I've been coding with PHP for over a year now, but this is seriously hampering my percieved reliability of the language in OOP.
An example of this is that I have created a PHP generated calendar which displays the current month and the following month. The layout is in HTML, of course, and with each day there may be events that have been scheduled. So depending on the number of events each month there is an extensive loop to echo the current day, then highlight the cell if there is an event. The information is being pulled from a mysql query and I'm just reusing the query results....nothing that PHP would have to break a sweat over. After a great many loops, if I try to use the object again to perform another operation, say, sending another query to the db and retrieve it, it gives me back funky results. In this case, everything except the second returned row(?!?) After trying to debug for an hour, I create another object to try getting data and the information is successfully returned.
Now, I'm not ruling out programming errors or application memory leaks, but has anyone else experienced this?
Is there a limit to object size or usage? Do I have to reset an object for certain operations?
I'd appreciate kind-hearted suggestions.