respect-validation/docs/rules/Countable.md

20 lines
415 B
Markdown
Raw Normal View History

2015-10-17 22:08:25 +02:00
# Countable
- `v::countable()`
Validates if the input is countable, in other words, if you're allowed to use
[count()](http://php.net/count) function on it.
```php
v::countable()->validate([]); // true
v::countable()->validate(new ArrayObject()); // true
v::countable()->validate('string'); // false
```
***
See also:
* [ArrayVal](ArrayVal.md)
2015-10-17 21:55:00 +02:00
* [Instance](Instance.md)
2016-08-03 09:59:32 +02:00
* [IterableType](IterableType.md)