xref: /PHP-5.5/ext/calendar/tests/bug55797_1.phpt (revision 74cc4c8c)
1--TEST--
2Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
3--SKIPIF--
4<?php
5include 'skipif.inc';
6if (PHP_INT_SIZE != 4) {
7        die("skip this test is for 32bit platform only");
8}
9?>
10--FILE--
11<?php
12$x = 882858030;
13
14var_dump(cal_from_jd($x, CAL_GREGORIAN));
15--EXPECTF--
16array(9) {
17  ["date"]=>
18  string(5) "0/0/0"
19  ["month"]=>
20  int(0)
21  ["day"]=>
22  int(0)
23  ["year"]=>
24  int(0)
25  ["dow"]=>
26  int(%d)
27  ["abbrevdayname"]=>
28  string(%d) "%s"
29  ["dayname"]=>
30  string(%d) "%s"
31  ["abbrevmonth"]=>
32  string(0) ""
33  ["monthname"]=>
34  string(0) ""
35}
36
37