HH\Vector::reverse

Reverse the elements of the current Vector in place

Description

public function reverse(): void

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Vector\Reverse;

$v = Vector {'red', 'green', 'blue', 'yellow'};

$v->reverse();

var_dump($v);
Output
object(HH\Vector)#1 (4) {
  [0]=>
  string(6) "yellow"
  [1]=>
  string(4) "blue"
  [2]=>
  string(5) "green"
  [3]=>
  string(3) "red"
}