Skip to content

Installation

Valicomb is a simple, minimal PHP validation library with zero dependencies. Completely rewritten for PHP 8.2+ with security-first design, strict type safety, and modern PHP features.

  • PHP 8.2 or higher
  • ext-mbstring extension

Install Valicomb using Composer:

Terminal window
composer require frostybee/valicomb
  • For high-precision numeric comparisons, consider installing the BCMath extension. If you are comparing floating-point numbers with min/max validators, BCMath provides greater accuracy and reliability. Valicomb will automatically use it if available.
  • Modern PHP 8.2+ support with strict types turned on, so everything is fully typed and predictable.
  • Security-first approach that helps guard against things like ReDoS, type juggling issues, path traversal, and similar problems.
  • Thoroughly tested, with over 430 tests making sure things behave the way they should.
  • No external dependencies, other than the standard ext-mbstring extension.
  • Clean and straightforward API that’s easy to read and chain together.
  • Built-in i18n support, offering 33 languages out of the box.
  • 54 ready-to-use validation rules covering the most common validation needs.
  • Easy to extend, so you can add your own custom validation rules when needed.
  • Clean, modern codebase, fully passing PHPStan Level 8 checks.
use Frostybee\Valicomb\Validator;
$v = new Validator(['email' => 'test@example.com', 'age' => '25']);
$v->rule('required', ['email', 'age']);
$v->rule('email', 'email');
$v->rule('integer', 'age');
if ($v->validate()) {
echo "Validation passed!";
} else {
print_r($v->errors());
}