HH\Pair::count

Description

public function count(): int

Returns 2; a Pair always has two values.

Return Values

  • int - 2

Examples

This shows that a Pair always has a count of 2:

<?hh

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

$p = Pair {'foo', -1.5};
var_dump($p->count());

$p = Pair {null, null};
var_dump($p->count());
Output
int(2)
int(2)