I am curious, is there a size limit on serialize in PHP. Would it be possible to serialize an array with 5,000 keys and values so it can be stored into a cache?
I am
If you want to cache it (so I assume performance is the issue), use apc_add instead to avoid the performance hit of converting it to a string + gain cache in memory.
As stated above the only size limit is available memory.
A few other gotchas: serialize'd data is not portable between multi-byte and single-byte character encodings. PHP5 classes include NUL bytes that can cause havoc with code that doesn't expect them.