mirror of
https://github.com/php/php-src.git
synced 2026-04-29 19:23:22 +02:00
472fc3a2a9
Same issue as I fixed in DateInterval construction before.
22 lines
418 B
PHP
22 lines
418 B
PHP
--TEST--
|
|
DateInterval with bad format should not leak period
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
$interval = new DateInterval('P3"D');
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$perid = new DatePeriod('P3"D');
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
DateInterval::__construct(): Unknown or bad format (P3"D)
|
|
DatePeriod::__construct(): Unknown or bad format (P3"D)
|