count

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     public function add()

    {

        $this->livewireList[] = count($this->livewireList);

    }



    public function render()
<?php     public function addList()

    {

        $this->list[] = ['id' => count($this->list)];

    }



    public function removeList()
<?php     public function addList()

    {

        $this->list[] = ['id' => (count($this->list) + 1), 'name' => 'test' . (count($this->list) + 1)];

    }



    public function removeList()
<?php     public function addList()

    {

        $this->list[] = ['id' => count($this->list)];

    }



    public function updatedList()
<?php     public function reset(...$properties)

    {

        $properties = count($properties) && is_array($properties[0])

            ? $properties[0]

            : $properties;
<?php     protected function resetExcept(...$properties)

    {

        if (count($properties) && is_array($properties[0])) {

            $properties = $properties[0];

        }
<?php {

    static function isSyntheticTuple($payload) {

        return is_array($payload)

            && count($payload) === 2

            && isset($payload[1]['s']);

    }
<?php         preg_match('/(?:\n\s*|^\s*)<([a-zA-Z0-9\-]+)/', $html, $matches, PREG_OFFSET_CAPTURE);



        throw_unless(

            count($matches),

            new RootTagMissingFromViewException

        );
<?php             $assets = array_values(SupportScriptsAndAssets::getAssets());




            if (count($assets) > 0) {

                foreach ($assets as $asset) {

                    $assetsHead .= $asset."\n";

                }
<?php     public function reset(...$properties)

    {

        $properties = count($properties) && is_array($properties[0])

            ? $properties[0]

            : $properties;
<?php         $relations = $target->getQueueableRelations();



        if (count($relations)) {

            $meta['relations'] = $relations;

        }
<?php             $collection->loadMissing($meta['relations']);

        }



        if (count($data)) {

            foreach ($data as $key => $childData) {

                $childData[1]['__child_from_parent'] = $collection->get($key);
<?php     protected function loadCollection($meta)

    {

        if (isset($meta['keys']) && count($meta['keys']) >= 0 && ! empty($meta['modelClass'])) {

            $model = new $meta['modelClass'];



            if (isset($meta['connection'])) {
<?php         $relations = $target->getQueueableRelations();



        if (count($relations)) {

            $meta['relations'] = $relations;

        }
<?php         $value = $array[$first];



        if (count($segments) > 0) {

            return static::dataGetWithoutWildcardSupport($value, implode('.', $segments), $default);

        }