mirror of
https://github.com/php/php-src.git
synced 2026-04-20 22:41:20 +02:00
Files
e079e753dcdf22229d2c386dc6b87f2ebf991721
20 lines
573 B
PHP
20 lines
573 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";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0
|
|
DatePeriod::__construct(): The recurrence count '-1' is invalid. Needs to be > 0
|