IterableType

February 3, 2026 · View on GitHub

  • IterableType()

Validates whether the input is iterable, meaning that it matches the built-in compile time type alias iterable.

v::iterableType()->assert([]);
// Validation passes successfully

v::iterableType()->assert(new ArrayObject());
// Validation passes successfully

v::iterableType()->assert(new stdClass());
// → `stdClass {}` must be iterable

v::iterableType()->assert('string');
// → "string" must be iterable

Templates

IterableType::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be iterable
inverted{{subject}} must not iterable

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Types

Changelog

VersionDescription
3.0.0Rejected stdClass as iterable
1.0.8Renamed from Iterable to IterableType
1.0.0Created as Iterable

See Also