public function shift($size = 1, $value = false)
	{
		$size = (int) $size;

		if ($size > 0)
		{
			$min = min($this->size, $size);

			for ($i = $this->size - 1; $i >= $min; $i--)
			{
				$this[$i] = $this[$i - $min];
			}

			for ($i = 0; $i < $min; $i++)
			{
				$this[$i] = $value;
			}
		}
		else
		{
			$min = min($this->size, -$size);

			for ($i = 0; $i < $this->size - $min; $i++)
			{
				$this[$i] = $this[$i + $min];
			}

			for ($i = $this->size - $min; $i < $this->size; $i++)
			{
				$this[$i] = $value;
			}
		}

		return $this;
	}
public function shift($size = 1, $value = false)
	{
		$size = (int) $size;

		if ($size > 0)
		{
			$min = min($this->size, $size);

			for ($i = $this->size - 1; $i >= $min; $i--)
			{
				$this[$i] = $this[$i - $min];
			}

			for ($i = 0; $i < $min; $i++)
			{
				$this[$i] = $value;
			}
		}
		else
		{
			$min = min($this->size, -$size);

			for ($i = 0; $i < $this->size - $min; $i++)
			{
				$this[$i] = $this[$i + $min];
			}

			for ($i = $this->size - $min; $i < $this->size; $i++)
			{
				$this[$i] = $value;
			}
		}

		return $this;
	}
public function shift ( $ size = 1 , $ value = false ) { $ size = ( int ) $ size ; if ( $ size > 0 ) { $ min = min ( $ this -> size , $ size ) ; for ( $ i = $ this -> size - 1 ; $ i >= $ min ; $ i -- ) { $ this [ $ i ] = $ this [ $ i - $ min ] ; } for ( $ i = 0 ; $ i < $ min ; $ i ++ ) { $ this [ $ i ] = $ value ; } } else { $ min = min ( $ this -> size , - $ size ) ; for ( $ i = 0 ; $ i < $ this -> size - $ min ; $ i ++ ) { $ this [ $ i ] = $ this [ $ i + $ min ] ; } for ( $ i = $ this -> size - $ min ; $ i < $ this -> size ; $ i ++ ) { $ this [ $ i ] = $ value ; } } return $ this ; }
Shift a bit array.

@param   int       $size   Size to shift.
Negative value means the shifting is done right to left while
positive value means the shifting is done left to right.
@param   boolean   $value  Value to shift

@return  BitArray  $this for chaining

@since   1.2.0
Shift a bit array .