mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 23:59:51 +01:00
18 lines
375 B
PHP
18 lines
375 B
PHP
--FILE--
|
|
<?php
|
|
require 'vendor/autoload.php';
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
use Respect\Validation\Exceptions\MinimumAgeException;
|
|
use Respect\Validation\Validator as v;
|
|
|
|
try {
|
|
v::MinimumAge(12)->check(new DateTime('2010-10-12'));
|
|
} catch (MinimumAgeException $exception) {
|
|
echo $exception->getMainMessage();
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
The age must be 12 years or more.
|