public static function fromString($string)
	{
		$bits = new BitArray(strlen($string));
		$ord = 0;

		for ($offset = 0; $offset < $bits->size; $offset++)
		{
			if ($string[$offset] !== '0')
			{
				$ord |= 1 << $offset % 8;
			}

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

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

		return $bits;
	}
public static function fromString($string)
	{
		$bits = new BitArray(strlen($string));
		$ord = 0;

		for ($offset = 0; $offset < $bits->size; $offset++)
		{
			if ($string[$offset] !== '0')
			{
				$ord |= 1 << $offset % 8;
			}

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

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

		return $bits;
	}
public static function fromString ( $ string ) { $ bits = new BitArray ( strlen ( $ string ) ) ; $ ord = 0 ; for ( $ offset = 0 ; $ offset < $ bits -> size ; $ offset ++ ) { if ( $ string [ $ offset ] !== '0' ) { $ ord |= 1 << $ offset % 8 ; } if ( $ offset % 8 === 7 ) { $ bits -> data [ ( int ) ( $ offset / 8 ) ] = chr ( $ ord ) ; $ ord = 0 ; } } if ( $ offset % 8 !== 0 ) { $ bits -> data [ ( int ) ( $ offset / 8 ) ] = chr ( $ ord ) ; } return $ bits ; }
Create a new BitArray from a bit string

@param   string  $string  A bit string

@return  BitArray  A new BitArray

@since   1.0.0
Create a new BitArray from a bit string