public static function rotateX(array &$array, int $distance,
			int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
	{
		self::prepare($array, $stopX, $stopY);
		$rotateLeft = $distance > 0;
		$distance = abs($distance) % ($stopX - $startX);
		$x = $rotateLeft ? $startX + $distance : $stopX - $distance;
		self::reverseX($array, $startX, $startY, $x,     $stopY);
		self::reverseX($array, $x,      $startY, $stopX, $stopY);
		self::reverseX($array, $startX, $startY, $stopX, $stopY);
	}
public static function rotateX(array &$array, int $distance,
			int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
	{
		self::prepare($array, $stopX, $stopY);
		$rotateLeft = $distance > 0;
		$distance = abs($distance) % ($stopX - $startX);
		$x = $rotateLeft ? $startX + $distance : $stopX - $distance;
		self::reverseX($array, $startX, $startY, $x,     $stopY);
		self::reverseX($array, $x,      $startY, $stopX, $stopY);
		self::reverseX($array, $startX, $startY, $stopX, $stopY);
	}
public static function rotateX ( array & $ array , int $ distance , int $ startX = 0 , int $ startY = 0 , int $ stopX = null , int $ stopY = null ) { self :: prepare ( $ array , $ stopX , $ stopY ) ; $ rotateLeft = $ distance > 0 ; $ distance = abs ( $ distance ) % ( $ stopX - $ startX ) ; $ x = $ rotateLeft ? $ startX + $ distance : $ stopX - $ distance ; self :: reverseX ( $ array , $ startX , $ startY , $ x , $ stopY ) ; self :: reverseX ( $ array , $ x , $ startY , $ stopX , $ stopY ) ; self :: reverseX ( $ array , $ startX , $ startY , $ stopX , $ stopY ) ; }
Array items rotate left if distance is greater than 0.
Array items rotate left if distance is greater than 0 .