xref: /PHP-8.0/ext/date/tests/bug53437_var3.phpt (revision 866adb12)
1--TEST--
2Bug #53437 DateInterval unserialize bad data, 32 bit
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?>
5--FILE--
6<?php
7$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
8
9$di = unserialize($s);
10var_dump($di);
11
12?>
13--EXPECTF--
14object(DateInterval)#%d (16) {
15  ["y"]=>
16  int(2)
17  ["m"]=>
18  int(0)
19  ["d"]=>
20  int(0)
21  ["h"]=>
22  int(6)
23  ["i"]=>
24  int(8)
25  ["s"]=>
26  int(0)
27  ["weekday"]=>
28  int(10)
29  ["weekday_behavior"]=>
30  int(10)
31  ["first_last_day_of"]=>
32  int(0)
33  ["invert"]=>
34  int(0)
35  ["days"]=>
36  int(0)
37  ["special_type"]=>
38  int(0)
39  ["special_amount"]=>
40  int(-1)
41  ["have_weekday_relative"]=>
42  int(%d)
43  ["have_special_relative"]=>
44  int(0)
45  ["f"]=>
46  float(0)
47}
48