xref: /PHP-8.1/ext/date/tests/bug53437_var2.phpt (revision a555cc0b)
1--TEST--
2Bug #53437 DateInterval basic serialization
3--FILE--
4<?php
5$di0 = new DateInterval('P2Y4DT6H8M');
6
7$s = serialize($di0);
8
9$di1 = unserialize($s);
10
11var_dump($di0, $di1);
12
13?>
14--EXPECT--
15object(DateInterval)#1 (16) {
16  ["y"]=>
17  int(2)
18  ["m"]=>
19  int(0)
20  ["d"]=>
21  int(4)
22  ["h"]=>
23  int(6)
24  ["i"]=>
25  int(8)
26  ["s"]=>
27  int(0)
28  ["f"]=>
29  float(0)
30  ["weekday"]=>
31  int(0)
32  ["weekday_behavior"]=>
33  int(0)
34  ["first_last_day_of"]=>
35  int(0)
36  ["invert"]=>
37  int(0)
38  ["days"]=>
39  bool(false)
40  ["special_type"]=>
41  int(0)
42  ["special_amount"]=>
43  int(0)
44  ["have_weekday_relative"]=>
45  int(0)
46  ["have_special_relative"]=>
47  int(0)
48}
49object(DateInterval)#2 (16) {
50  ["y"]=>
51  int(2)
52  ["m"]=>
53  int(0)
54  ["d"]=>
55  int(4)
56  ["h"]=>
57  int(6)
58  ["i"]=>
59  int(8)
60  ["s"]=>
61  int(0)
62  ["f"]=>
63  float(0)
64  ["weekday"]=>
65  int(0)
66  ["weekday_behavior"]=>
67  int(0)
68  ["first_last_day_of"]=>
69  int(0)
70  ["invert"]=>
71  int(0)
72  ["days"]=>
73  bool(false)
74  ["special_type"]=>
75  int(0)
76  ["special_amount"]=>
77  int(0)
78  ["have_weekday_relative"]=>
79  int(0)
80  ["have_special_relative"]=>
81  int(0)
82}
83