OK, my little tip (and I don't know if it's already been said or not ... too many posts in here, we should start a part 2 or something)

Don't ever, EVER, under ANY circumstances, EVER attempt to serialize objects, store them, and recover them later.

PHP's serializing object support (especially if the objects are complex, and stored object-within-object in a tree, with each one having reference variables to its parent, etc. etc.) is very sketchy. You can serialize and unserialize stuff and data will be changed, or you'll just get random crashes and errors.

For example: at a certain point I was trying to access something after unserializing in my object structure like this:
$blah = $object->array[$id1]->array2[$id2]->getID();
$something = $object->array[$id1]->array2[$id2]->getSomething();
It would get me the $blah just fine, but the $something would give me a "Can't run method on non-existing object" error ... basically the object disappeared between the two statements. When I just built it up by hand to test it, instead of unserializing, it worked fine.


The Moral Is: Thou Shalt Not Serialize Objects, else { Thou Shalt Have Very Large and Very Arbitrary Problems; }