mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
21 lines
599 B
PHP
21 lines
599 B
PHP
--TEST--
|
|
DatePeriod: Test wrong recurrence parameter on __construct
|
|
--FILE--
|
|
<?php
|
|
try {
|
|
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0);
|
|
} catch (Exception $exception) {
|
|
echo $exception->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), -1);
|
|
} catch (Exception $exception) {
|
|
echo $exception->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
|
|
DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
|