xref: /PHP-7.3/ext/date/tests/bug48678.phpt (revision d2cde0bf)
1--TEST--
2Bug #48678 (DateInterval segfaults when unserialising)
3--FILE--
4<?php
5$x = new DateInterval("P3Y6M4DT12H30M5S");
6print_r($x);
7$y = unserialize(serialize($x));
8print_r($y);
9--EXPECT--
10DateInterval Object
11(
12    [y] => 3
13    [m] => 6
14    [d] => 4
15    [h] => 12
16    [i] => 30
17    [s] => 5
18    [f] => 0
19    [weekday] => 0
20    [weekday_behavior] => 0
21    [first_last_day_of] => 0
22    [invert] => 0
23    [days] =>
24    [special_type] => 0
25    [special_amount] => 0
26    [have_weekday_relative] => 0
27    [have_special_relative] => 0
28)
29DateInterval Object
30(
31    [y] => 3
32    [m] => 6
33    [d] => 4
34    [h] => 12
35    [i] => 30
36    [s] => 5
37    [f] => 0
38    [weekday] => 0
39    [weekday_behavior] => 0
40    [first_last_day_of] => 0
41    [invert] => 0
42    [days] =>
43    [special_type] => 0
44    [special_amount] => 0
45    [have_weekday_relative] => 0
46    [have_special_relative] => 0
47)
48