xref: /PHP-8.0/ext/date/tests/bug79015.phpt (revision 866adb12)
1--TEST--
2Bug #79015 (undefined-behavior in php_date.c)
3--FILE--
4<?php
5$payload = 'O:12:"DateInterval":16:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";b:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}';
6var_dump(unserialize($payload));
7?>
8--EXPECTF--
9object(DateInterval)#%d (16) {
10  ["y"]=>
11  int(1)
12  ["m"]=>
13  int(0)
14  ["d"]=>
15  int(4)
16  ["h"]=>
17  int(0)
18  ["i"]=>
19  int(0)
20  ["s"]=>
21  int(0)
22  ["f"]=>
23  float(%f)
24  ["weekday"]=>
25  int(0)
26  ["weekday_behavior"]=>
27  int(0)
28  ["first_last_day_of"]=>
29  int(0)
30  ["invert"]=>
31  int(0)
32  ["days"]=>
33  bool(false)
34  ["special_type"]=>
35  int(0)
36  ["special_amount"]=>
37  int(0)
38  ["have_weekday_relative"]=>
39  int(0)
40  ["have_special_relative"]=>
41  int(0)
42}
43