xref: /PHP-8.0/ext/calendar/tests/bug55797_1.phpt (revision 7aacc705)
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?>
16--EXPECTF--
17array(9) {
18  ["date"]=>
19  string(5) "0/0/0"
20  ["month"]=>
21  int(0)
22  ["day"]=>
23  int(0)
24  ["year"]=>
25  int(0)
26  ["dow"]=>
27  int(%d)
28  ["abbrevdayname"]=>
29  string(%d) "%s"
30  ["dayname"]=>
31  string(%d) "%s"
32  ["abbrevmonth"]=>
33  string(0) ""
34  ["monthname"]=>
35  string(0) ""
36}
37