protected function decode($encoded) {
		$val = substr($encoded, 1);
		switch ($encoded[0]) {
			case self::T_ARRAY:
				return json_decode($val, true);
			case self::T_INT:
				return intval($val);
			case self::T_BOOLEAN:
				return !!$val;
			case self::T_DOUBLE:
				return floatval($val);
			case self::T_OBJECT:
				return unserialize($val);
			default:
				return $val;
		}
	}