*added auto encoding based on object type which can be overridden as per Kiddy's request.  I think this is a great addition. Default type is string (str), objects default type is (php) which serializes, also json and int exist.
*added phpdoc for types available