HH\Map::toValuesArray

Description

public function toValuesArray(): array<Tv>

Returns an array containing the values from the current Map.

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Map\ToValuesArray;

$m = Map {
  'red' => '#ff0000',
  'green' => '#00ff00',
  'blue' => '#0000ff',
  'yellow' => '#ffff00',
};

$array = $m->toValuesArray();

var_dump(is_array($array));
var_dump($array);
Output
bool(true)
array(4) {
  [0]=>
  string(7) "#ff0000"
  [1]=>
  string(7) "#00ff00"
  [2]=>
  string(7) "#0000ff"
  [3]=>
  string(7) "#ffff00"
}