public static Object unserialize(byte[] objBytes) {
    	Object returnObject;
    	PHPDeserializer serializedPhpParser;
  		serializedPhpParser = new PHPDeserializer(objBytes);
   		try {
   			returnObject = serializedPhpParser.parse();
   		} catch (Throwable e) {
   			return null;
   		}

		if (returnObject instanceof String) {
			if (PHPSerializer.isSerialized((String)returnObject)) {
				returnObject = Functions.unserialize((String) returnObject);
			}
		}
		// here's where we create an appropriate object from a PHP object
		if (returnObject == null) return null;
		if (returnObject instanceof PhpObject) {
			PhpObject phpo = (PhpObject) returnObject;
			return phpo.getRealObject();
		}
		serializedPhpParser.objHistory.clear();
		return returnObject;
    }