public static function decode($json, $assoc = false, $maxDepth = 512)
	{
		$result = @json_decode($json, $assoc, $maxDepth);
		
		if($result === NULL)
		{
			switch($error = json_last_error())
			{
				case JSON_ERROR_NONE:
					return NULL;
				case JSON_ERROR_CTRL_CHAR:
					throw new JsonUnserializationException('An invalid control character was found in JSON-encoded data', $error);
				case JSON_ERROR_DEPTH:
					throw new JsonUnserializationException(sprintf('Maximum nesting depth of %u exceeded in JSON-encoded data', $maxDepth), $error);
				case JSON_ERROR_SYNTAX:
					throw new JsonUnserializationException('A syntax error has been detected in JSON-encoded data', $error);
				default:
					throw new JsonUnserializationException('An unknown error occured while unserializing JSON-encoded data', $error);
			}
		}
		
		return $result;
	}