public static function toAssoc($arr)
	{
		if (($count = count($arr)) % 2 > 0)
		{
			throw new \BadMethodCallException('Number of values in to_assoc must be even.');
		}
		$keys = $vals = array();

		for ($i = 0; $i < $count - 1; $i += 2)
		{
			$keys[] = array_shift($arr);
			$vals[] = array_shift($arr);
		}
		return array_combine($keys, $vals);
	}