xref: /PHP-8.2/ext/date/tests/bug70153.phpt (revision cae1d4ad)
1--TEST--
2Bug #70153 (\DateInterval incorrectly unserialized)
3--FILE--
4<?php
5$i1 = \DateInterval::createFromDateString('+1 month');
6print_r($i1);
7
8$s = serialize($i1);
9print_r($s);
10
11echo "\n";
12
13$i2 = unserialize($s);
14print_r($i2);
15
16var_dump($i1->days, $i2->days);
17?>
18--EXPECT--
19DateInterval Object
20(
21    [from_string] => 1
22    [date_string] => +1 month
23)
24O:12:"DateInterval":2:{s:11:"from_string";b:1;s:11:"date_string";s:8:"+1 month";}
25DateInterval Object
26(
27    [from_string] => 1
28    [date_string] => +1 month
29)
30bool(false)
31bool(false)
32