summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug78751.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/tests/bug78751.phpt')
-rw-r--r--ext/date/tests/bug78751.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/date/tests/bug78751.phpt b/ext/date/tests/bug78751.phpt
new file mode 100644
index 0000000000..6021b9f6ae
--- /dev/null
+++ b/ext/date/tests/bug78751.phpt
@@ -0,0 +1,16 @@
+--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)