pocketmine\nbt\tag\ListTag::count PHP Method

count() public method

public count ( $mode = COUNT_NORMAL )
    public function count($mode = COUNT_NORMAL)
    {
        for ($i = 0; true; $i++) {
            if (!isset($this->{$i})) {
                return $i;
            }
            if ($mode === COUNT_RECURSIVE) {
                if ($this->{$i} instanceof \Countable) {
                    $i += count($this->{$i});
                }
            }
        }
        return $i;
    }