HH\Vector::count

Description

public function count(): int

Provides the number of elements in current Vector.

Return Values

  • int - The number of elements in current Vector.

Examples

<?hh

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

$v = Vector {};
var_dump($v->count());

$v = Vector {'red', 'green', 'blue', 'yellow'};
var_dump($v->count());
Output
int(0)
int(4)