Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Counts all elements in an array or in a Countable object
Alias sizeof
<?php count(Countable|array $value, int $mode = COUNT_NORMAL): int
<?php             $this->io->writeError(

                '<warning>Warning: Ambiguous class resolution, "'.$className.'"'.

                ' was found '. (count($ambiguousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambiguousPaths) .'", the first will be used.</warning>'

            );

        }
<?php             ));

        }



        return count($classMap);

    }
<?php             return array();

        }



        $p = new PhpFileCleaner($contents, count($matches[0]));

        $contents = $p->clean();

        unset($p);
<?php         $classes = array();

        $namespace = '';



        for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {

            if (!empty($matches['ns'][$i])) {

                $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\';

            } else {
<?php         $packages = $repo->findPackages($packageName, $version);



        if (count($packages) > 1) {

            $package = reset($packages);

            $io->writeError('<info>Found multiple matches, selected '.$package->getPrettyString().'.</info>');

            $io->writeError('Alternatives were '.implode(', ', array_map(function ($p) {
<?php     protected function printTree($results, $prefix = '', $level = 1)

    {

        $count = count($results);

        $idx = 0;

        foreach ($results as $result) {

            list($package, $link, $children) = $result;
<?php         foreach ($results as $result) {

            list($package, $link, $children) = $result;



            $color = $this->colors[$level % count($this->colors)];

            $prevColor = $this->colors[($level - 1) % count($this->colors)];

            $isLast = (++$idx == $count);

            $versionText = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '' : $package->getPrettyVersion();
<?php             list($package, $link, $children) = $result;



            $color = $this->colors[$level % count($this->colors)];

            $prevColor = $this->colors[($level - 1) % count($this->colors)];

            $isLast = (++$idx == $count);

            $versionText = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '' : $package->getPrettyVersion();

            $packageText = rtrim(sprintf('<%s>%s</%1$s> %s', $color, $package->getPrettyName(), $versionText));
<?php                 return 0;

            }



            if (2 === count($values)) {

                $this->configSource->addRepository($matches[1], array(

                    'type' => $values[0],

                    'url' => $values[1],
<?php                 return 0;

            }



            if (1 === count($values)) {

                $value = strtolower($values[0]);

                if (true === $booleanValidator($value)) {

                    if (false === $booleanNormalizer($value)) {
<?php             }



            if ($matches[1] === 'bitbucket-oauth') {

                if (2 !== count($values)) {

                    throw new \RuntimeException('Expected two arguments (consumer-key, consumer-secret), got '.count($values));

                }

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
<?php             if ($matches[1] === 'bitbucket-oauth') {

                if (2 !== count($values)) {

                    throw new \RuntimeException('Expected two arguments (consumer-key, consumer-secret), got '.count($values));

                }

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);

                $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
<?php                 }

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);

                $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));

            } elseif ($matches[1] === 'gitlab-token' && 2 === count($values)) {

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);

                $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'token' => $values[1]));

            } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) {
<?php                 $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);

                $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'token' => $values[1]));

            } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) {

                if (1 !== count($values)) {

                    throw new \RuntimeException('Too many arguments, expected only one token');

                }

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
<?php                 $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);

                $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], $values[0]);

            } elseif ($matches[1] === 'http-basic') {

                if (2 !== count($values)) {

                    throw new \RuntimeException('Expected two arguments (username, password), got '.count($values));

                }

                $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);