Ds\Vector::rotate

Ds\Vector::rotate

(PECL ds >= 1.0.0)

Ds\Vector::rotateRotates the vector by a given number of rotations.

Description

public void Ds\Vector::rotate ( int $rotations )

Rotates the vector by a given number of rotations, which is equivalent to successively calling $vector->push($vector->shift()) if the number of rotations is positive, or $vector->unshift($vector->pop()) if negative.

Parameters

rotations