public static function serialize($variable) { $stream = new HproseStringStream(); $hproseWriter = new HproseWriter($stream); $hproseWriter->serialize($variable); return $stream->toString(); }