Count the occurrences of value in $this list.

@param $value

@return int
5090
public function countValue($value)
    {
        $count = 0;
        foreach ($this->source as $arrayVal) {
            if ($arrayVal === $value) {
                ++$count;
            }
        }

        return $count;
    }
795106
public function checkDigits($value, $count)
    {

        if (is_numeric($value)) {
            $value = "$value";
        }

        if (!Type::isStringLike($value)) {
            return false;
        }

        return ! preg_match('/[^0-9]/', "$value")
            && strlen("$value") == $count;
    }
1138381
public function append(string $value): int
    {
        return intval($this->handle->append($this->name, $value));
    }
867530
public function count()
    {
        if ($this->iterator instanceof Countable) {
            return $this->iterator->count();
        }

        return iterator_count($this->iterator);
    }
1173614
protected function isSequence($value)
    {
        if (!Helper::isSequential($value)) {
            return false;
        }

        if ($value === []) {
            return true;
        }

        $i=0;

        $lastItemType = null;

        foreach ($value as $key=>$item) {

            if ($key !== $i) {
                return false;
            }

            $itemType = Type::of($item);

            // TODO: list could be typed by common class or interface
            if ($i !== 0 && $itemType != $lastItemType) {
                return false;
            }

            $lastItemType = $itemType;
            $i++;
        }

        return true;

    }
1104222
public function push($value)
    {
        $this->offsetSet($this->count(), $value);
        $this->seek($this->count() - 1);
    }
356422
public function setTotal($value)
    {
        if (!StaticValidator::isValid('number', $value)) {
            return $this;
        }

        $this->_total = StaticFilter::filter('number',$value);
        $this->_pages = ceil($this->_total / $this->_rowsPerPage);
        return $this;
    }
778075
public function countByIndex( $key, $value ){
		$conditions	= array( $key => $value );
		return $this->table->count( $conditions );
	}
362788
public function sentinelSearch($value){
		
		$l = $this->count();
		$arr = $this->_Arr;
		$arr[$l] = $value;
		$i = 0;
		
		while($arr[$i] !== $value){
			++$i;
		}
		
		return $i !== $l ? $i : static::NO_INDEX;
		
	}
553251
private function validatePageLimit($value): int
    {
        $ruleIndexes    = $this->serializerClass::readPageLimitRuleIndexes($this->getSerializedRuleSet());
        $validatedValue = $this->validatePaginationValue($value, $ruleIndexes);

        return $validatedValue;
    }
574000
public function with_count($value)
    {
        $with_counts = explode(',', $value);
        $model = $this->builder->getModel();
        $with_counts = collect($with_counts)->filter(function ($with_count) use($model) {
            if (str_contains($with_count, '.')) return ($model->{explode('.', $with_count)[0]}() instanceof Relation);
            return ($model->{$with_count}() instanceof Relation);
        })->toArray();
        return $this->builder->when(count($with_counts), function (Builder $query) use($with_counts) {
            if (is_null($query->getQuery()->columns)) $query->select([ '*' => $query->qualifyColumn('*') ]);
            $query->withCount($with_counts);
        });
    }
18516
public function checkReceived($value = null): ?EventCollection
    {
        $cardinality = $this->resetCardinality();
        $argumentCount = func_num_args();

        if (0 === $argumentCount) {
            $checkValue = false;
        } else {
            $checkValue = true;
            $value = $this->matcherFactory->adapt($value);
        }

        $isCall = $this->subject instanceof Call;
        $matchingEvents = [];
        $matchCount = 0;
        $eventCount = 0;

        foreach ($this->calls as $call) {
            $isMatchingCall = false;

            foreach ($call->iterableEvents() as $event) {
                if ($event instanceof ReceivedEvent) {
                    ++$eventCount;

                    if (!$checkValue || $value->matches($event->value())) {
                        $matchingEvents[] = $event;
                        $isMatchingCall = true;

                        if ($isCall) {
                            ++$matchCount;
                        }
                    }
                }
            }

            if (!$isCall && $isMatchingCall) {
                ++$matchCount;
            }
        }

        if ($isCall) {
            $totalCount = $eventCount;
        } else {
            $totalCount = $this->callCount;
        }

        if ($cardinality->matches($matchCount, $totalCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }

        return null;
    }
174977
public static int count(int[] array, int value) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] == value) {
                count++;
            }
        }
        return count;
    }
1027275
public function indexOf($value)
    {
        $count = $this->count();
        for ($i = 0; $i < $count; ++$i) {
            if ($value === $this->source[$i]) {
                return $i;
            }
        }
        throw new OutOfBoundsException("Value $value not found");
    }
842024
protected function filterable($value)
    {
        if (count($value) !== $this->expectedInputs) {
            throw new Exception\RuntimeException(
                sprintf(
                    'There are not enough values in the array to filter this date (Required: %d, Received: %d)',
                    $this->expectedInputs,
                    count($value)
                )
            );
        }
    }
896476
final public function countByColumn($column, $value, $field = null)
    {
        $this->validateShortcutData();
        $alias = 'count';

        if ($field === null) {
            $field = $this->getPk();
        }

        return (int) $this->db->select()
                            ->count($field, $alias)
                            ->from(static::getTableName())
                            ->whereEquals($column, $value)
                            ->query($alias);
    }
628975
public static function getValueAsList($value) {
		$tokens = token_get_all('<?php '.$value);

		$resultArray = array();
		
		// Le's find all the strings, and let's put each string in the table.
		foreach ($tokens as $token) {
			if ($token[0] == T_CONSTANT_ENCAPSED_STRING) {
				$resultArray[] = substr($token[1], 1, strlen($token[1])-2) ;
			}
		}

		return  $resultArray;
	}