← All docs

count()

Counts all elements in an array or Countable object.

count()

function count(array $value, int $mode = 0): int

Counts all elements in an array or Countable object.

Parameters:

  • $value (array)
  • $mode (int), default 0, optional

Returns: int

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how count is implemented in the compiler, see the internals page.