Added functions for serializing to PHP's serialization format.