xref: /PHP-7.0/ext/date/tests/bug48678.phpt (revision 0f9cf353)
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--EXPECTF--
10DateInterval Object
11(
12    [y] => 3
13    [m] => 6
14    [d] => 4
15    [h] => 12
16    [i] => 30
17    [s] => 5
18    [weekday] => 0
19    [weekday_behavior] => 0
20    [first_last_day_of] => 0
21    [invert] => 0
22    [days] =>
23    [special_type] => 0
24    [special_amount] => 0
25    [have_weekday_relative] => 0
26    [have_special_relative] => 0
27)
28DateInterval Object
29(
30    [y] => 3
31    [m] => 6
32    [d] => 4
33    [h] => 12
34    [i] => 30
35    [s] => 5
36    [weekday] => 0
37    [weekday_behavior] => 0
38    [first_last_day_of] => 0
39    [invert] => 0
40    [days] => 0
41    [special_type] => 0
42    [special_amount] => 0
43    [have_weekday_relative] => 0
44    [have_special_relative] => 0
45)
46