HH\Pair::toArray

Returns an array containing the values from the current Pair.

Description

public function toArray(): array

Returns an array containing the values from the current Pair.

This method is interchangeable with toValuesArray().

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Pair\ToArray;

$p = Pair {'foo', -1.5};

$array = $p->toArray();

var_dump(is_array($array));
var_dump($array);
Output
bool(true)
array(2) {
  [0]=>
  string(3) "foo"
  [1]=>
  float(-1.5)
}