Skip to content

IEnumerable.count() method

Marcel Kloubert edited this page Sep 25, 2015 · 4 revisions

IEnumerable->count() method

Counts the elements of that sequence (s. Count()).

Syntax

public function count() : int;

Result

The number of elements.

Examples

use \System\Linq\Enumerable;

$seq = Enumerable::fromValues(5979, 'TM', null);

// 3
$a1 = $seq->count();

$seq->reset();

// other way to do this
$a2 = count($seq);
Clone this wiki locally