1--TEST--
2Bug #80185 (jdtounix() fails after 2037)
3--EXTENSIONS--
4calendar
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
8?>
9--FILE--
10<?php
11try {
12    var_dump(jdtounix(2465712));
13} catch (ValueError $ex) {
14    echo $ex->getMessage(), PHP_EOL;
15}
16var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
17try {
18    var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
19} catch (ValueError $ex) {
20    echo $ex->getMessage(), PHP_EOL;
21}
22?>
23--EXPECT--
24jday must be between 2440588 and 2465443
25int(2147472000)
26jday must be between 2440588 and 2465443
27