Just to make absolutely sure, you're coding yourself in php?
If so, I believe the issue is that you're initializing new objects in an improper place. You must do it in the __construct() function.
I hope this helps, if so, I'd appreciate the money! :-)
If not, still do let me know, so that I can retract the bid!