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