is_countable

Supported Versions: PHP 7 >= 7.3.0, PHP 8
Verify that the contents of a variable is a countable value
<?php is_countable(mixed $value): bool
<?php     public function toHaveCount(int $count, string $message = ''): self

    {

        if (! is_countable($this->value) && ! is_iterable($this->value)) {

            InvalidExpectationValue::expected('countable|iterable');

        }
<?php     public function toHaveSameSize(Countable|iterable $expected, string $message = ''): self

    {

        if (! is_countable($this->value) && ! is_iterable($this->value)) {

            InvalidExpectationValue::expected('countable|iterable');

        }
<?php                 $message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);



                if (class_exists((string) $class) && (is_countable(class_parents($class)) ? count(class_parents($class)) : 0) > 0 && array_values(class_parents($class))[0] === TestCase::class) { // @phpstan-ignore-line

                    $message .= '. Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests';

                }