-
Couldn't load subscription status.
- Fork 8k
Closed as not planned
Labels
Description
Description
The following code:
<?php
$now = new DateTime();
$now->setTimestamp(PHP_INT_MAX);
$before = clone $now;
$date = new DateInterval('PT1M');
$date->invert = true;
$date->days = PHP_INT_MAX;
$date->h = PHP_INT_MAX;
$date->i = PHP_INT_MIN;
$date->s = PHP_INT_MAX;
$date->f = PHP_FLOAT_MAX;
$date->y = PHP_FLOAT_MIN;
$date->m = PHP_INT_MAX;
$date->d = PHP_INT_MIN;
$date_sub = date_sub($before, $date);Resulted in this output:
/home/dan/php-src/ext/date/lib/interval.c:358:36: runtime error: signed integer overflow: -9223372036854775808 * -1 cannot be represented in type 'long long int'
But I expected this output instead:
PHP Version
8.4.2
Operating System
ubuntu 22.04