public static function fromTraversable($traversable)
	{
		$bits = new BitArray(count($traversable));
		$offset = 0;
		$ord = 0;

		foreach ($traversable as $value)
		{
			if ($value)
			{
				$ord |= 1 << $offset % 8;
			}

			if ($offset % 8 === 7)
			{
				$bits->data[(int) ($offset / 8)] = chr($ord);
				$ord = 0;
			}

			$offset++;
		}

		if ($offset % 8 !== 0)
		{
			$bits->data[(int) ($offset / 8)] = chr($ord);
		}

		return $bits;
	}
public static function fromTraversable($traversable)
	{
		$bits = new BitArray(count($traversable));
		$offset = 0;
		$ord = 0;

		foreach ($traversable as $value)
		{
			if ($value)
			{
				$ord |= 1 << $offset % 8;
			}

			if ($offset % 8 === 7)
			{
				$bits->data[(int) ($offset / 8)] = chr($ord);
				$ord = 0;
			}

			$offset++;
		}

		if ($offset % 8 !== 0)
		{
			$bits->data[(int) ($offset / 8)] = chr($ord);
		}

		return $bits;
	}
public static function fromTraversable ( $ traversable ) { $ bits = new BitArray ( count ( $ traversable ) ) ; $ offset = 0 ; $ ord = 0 ; foreach ( $ traversable as $ value ) { if ( $ value ) { $ ord |= 1 << $ offset % 8 ; } if ( $ offset % 8 === 7 ) { $ bits -> data [ ( int ) ( $ offset / 8 ) ] = chr ( $ ord ) ; $ ord = 0 ; } $ offset ++ ; } if ( $ offset % 8 !== 0 ) { $ bits -> data [ ( int ) ( $ offset / 8 ) ] = chr ( $ ord ) ; } return $ bits ; }
Create a new BitArray from a traversable

@param   \Traversable  $traversable  A traversable and countable

@return  BitArray  A new BitArray

@since   1.0.0
Create a new BitArray from a traversable