xref: /php-src/ext/calendar/tests/bug80185.phpt (revision ac18dd0d)
1--TEST--
2Bug #80185 (jdtounix() fails after 2037)
3--EXTENSIONS--
4calendar
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE != 8) die("skip for 64bit platforms only");
8?>
9--FILE--
10<?php
11var_dump(jdtounix(2465712));
12var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
13try {
14    var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
15} catch (ValueError $ex) {
16    echo $ex->getMessage(), PHP_EOL;
17}
18?>
19--EXPECT--
20int(2170713600)
21int(9223372036854720000)
22jday must be between 2440588 and 106751993607888
23