summaryrefslogtreecommitdiff
path: root/ext/date/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-10-28 13:09:11 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-10-28 13:09:24 +0100
commit9e4c5db7331011da5daca701df0a62dcc2a622df (patch)
treedaf278e0597741a04d843a18d51504cf0cd3653b /ext/date/tests
parent99c84cd92aabbb4cfea585346242ff3e40941cc0 (diff)
parent736cd93ef53a458dbe5b86cab1f61721ccbc8b2d (diff)
downloadphp-git-9e4c5db7331011da5daca701df0a62dcc2a622df.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78751: Serialising DatePeriod converts DateTimeImmutable
Diffstat (limited to 'ext/date/tests')
-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)