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