mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
89c327f884
When getting the properties of a DatePeriod instance we have to retain the proper classes, and when restoring a DatePeriod instance we have to cater to DateTimeImmutable instances as well.
17 lines
450 B
PHP
17 lines
450 B
PHP
--TEST--
|
|
Bug #78751 (Serialising DatePeriod converts DateTimeImmutable)
|
|
--FILE--
|
|
<?php
|
|
$oDay = new DateTimeImmutable('2019-10-25');
|
|
$oDateInterval = DateInterval::createFromDateString('1 day');
|
|
$oDays = new DatePeriod($oDay, $oDateInterval, $oDay->modify('+1 day'));
|
|
$oDays = unserialize(serialize($oDays));
|
|
var_dump(
|
|
$oDays->start instanceof DateTimeImmutable,
|
|
$oDays->end instanceof DateTimeImmutable
|
|
);
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|