PHPackages                             z7zmey/rvalidate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. z7zmey/rvalidate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

z7zmey/rvalidate
================

Recursive array validator

0.0.5(9y ago)016BSDPHPPHP &gt;=5.6

Since Oct 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/z7zmey/rvalidate)[ Packagist](https://packagist.org/packages/z7zmey/rvalidate)[ Docs](https://github.com/z7zmey/RValidate)[ RSS](/packages/z7zmey-rvalidate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

\#RValidate

Library for the validation nested arrays with indicating the location and type of each pattern mismatch.

\##Installation

The best way to install RValidate is using Composer:

```
$ composer require z7zmey/rvalidate
```

Examples:
---------

[](#examples)

### Basic example

[](#basic-example)

```
use RValidate\Validator;
use RValidate\Sub;
use RValidate\Validators as V;
use RValidate\Filters as F;

$data = [
    'login' => 'Nick',
    'email' => 'nick@example.com',
    'password' => '*****'
];

$pattern = [
    new V\IsArray(),
    new V\keys(['login', 'email', 'password', 'name']),
    new Sub('login', [new V\IsString(), new V\Min(5)]),
    new Sub('email', new V\Email()),
    new Sub('password', new V\Regex('/[A-Za-z[:punct:] ]{6,}/')),
];

try {
    $result = Validator::run($data, $pattern);
} catch (\RValidate\Exceptions\ValidateException $e) {
    foreach ($e->getErrorsIterator() as $error) {
        echo $error . PHP_EOL;
    }
}
```

#### output

[](#output)

```
[] -> must contain keys [login, email, password, name]
[][login] -> must be minimal 5
[][password] -> must match /[A-Za-z[:punct:] ]{6,}/

```

### Nested example:

[](#nested-example)

```
$data = [
    'id_user' => 1011,
    'roles' => [
        'admin' => false,
        'moderator' => true,
        'tester' => false
    ]
];

$pattern = [
    new V\IsArray(),
    new V\keys(['id_user', 'roles']),
    new Sub(new F\Key\Equal('id_user'), [new V\IsInteger()]),
    new Sub(new F\Key\Equal('roles'),   [
        new V\Keys(['admin', 'moderator', 'tester']),
        new Sub(new F\Key\Equal('admin'),     [new V\IsBoolean()]),
        new Sub(new F\Key\Equal('moderator'), [new V\IsBoolean()]),
        new Sub(new F\Key\Equal('tester'),    [new V\IsBoolean()]),
    ]),
];
```

### Filter example:

[](#filter-example)

```
$data = [
    'String1'  => 'some string',
    'String2'  => 'some string',
    'String3'  => '',
    'Number1'  => 1,
    'Number2'  => 2,
    'Number44' => 44,
    'Alnum1'   => 'alpha1'
];

$pattern = [
    new V\IsArray(),
    new Sub(new F\Key\Regex('/^String\d+$/'), [new V\IsString()]),
    new Sub(new F\Key\Regex('/^Number\d+$/'), [new V\IsInteger()]),
    new Sub(new F\Key\Regex('/^Alnum\d+$/'), [new V\Alnum(), new V\NotEmpty()]),
];
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~253 days

Total

2

Last Release

3623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/925574fa0f8ce0833c7ade33347f94e5b62adfbfd74131bad747a56646f0a6b0?d=identicon)[z7zmey](/maintainers/z7zmey)

---

Top Contributors

[![z7zmey](https://avatars.githubusercontent.com/u/3993597?v=4)](https://github.com/z7zmey "z7zmey (54 commits)")

---

Tags

schemavalidatorvalidationarraynestedcomplexvalidatepatternmatcherrecursivervalidatez7zmey

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/z7zmey-rvalidate/health.svg)

```
[![Health](https://phpackages.com/badges/z7zmey-rvalidate/health.svg)](https://phpackages.com/packages/z7zmey-rvalidate)
```

###  Alternatives

[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[ptrofimov/matchmaker

Ultra-fresh PHP matching functions

27167.7k](/packages/ptrofimov-matchmaker)[lezhnev74/pasvl

Array Validator (regular expressions for nested array, sort of)

5253.7k3](/packages/lezhnev74-pasvl)[orisai/object-mapper

Raw data mapping to validated objects

1133.5k2](/packages/orisai-object-mapper)[brunoconte3/dev-utils

A complete PHP utility library for validating, formatting, comparing data, and more.

3525.7k](/packages/brunoconte3-dev-utils)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
