mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
988fc94bbb
We need to free not only p here, but also b and e.
29 lines
603 B
PHP
29 lines
603 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";
|
|
}
|
|
|
|
try {
|
|
new DatePeriod('2008-03-01T12:00:00Z1');
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
DateInterval::__construct(): Unknown or bad format (P3"D)
|
|
DatePeriod::__construct(): Unknown or bad format (P3"D)
|
|
DatePeriod::__construct(): Unknown or bad format (2008-03-01T12:00:00Z1)
|