-
Couldn't load subscription status.
- Fork 8k
Closed as not planned
Description
Description
The following code:
<?php
function get_date_offset($date) {
$timezone = new \DateTimeZone('Africa/Cairo');
$datetime = new \DateTime($date, $timezone);
return timezone_offset_get($datetime, 'UTC');
}
$date = '0000-00-00 00:00:00';
for ($i = 0; $i < PHP_INT_MAX; $i++) {
$date = gmdate("Y-m-d H:i:s", PHP_INT_MIN + $i);
echo get_date_offset($date). "\n";
}Resulted in this output:
/home/dan/php-src/ext/date/lib/tm2unixtime.c:403:4: runtime error: signed integer overflow: -9223372036854775808 - 7509 cannot be represented in type 'long long int'
But I expected this output instead:
PHP Version
8.4.2
Operating System
ubuntu 22.04