[php-src] Issue #20967: DateTime[Immutable]::createFromTimestamp(float) misses support for 64bit integers or 32bit environments

[email protected] (marc-mabe)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/20967
Author: marc-mabe

### Description

The following code:

```php
<?php

$dt = DateTime::createFromFormat('U', '2147483647');
var_dump($dt);

$dt = $dt->modify('+1 second');
var_dump($dt);

$ts = $dt->format('U');
$tsf = (float)$ts;
var_dump($ts, $tsf);

$dt2 = DateTime::createFromTimestamp($tsf);
```

Resulted in this output:
```
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2038-01-19 03:14:07.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2038-01-19 03:14:08.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}
string(10) "2147483648"
float(2147483648)

Fatal error: Uncaught DateRangeError: DateTime::createFromTimestamp(): Argument #1 ($timestamp) must be a finite number between -2147483648 and 2147483647.999999, 2.14748e+9 given 
```

But I expected this output instead:
```
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2038-01-19 03:14:07.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2038-01-19 03:14:08.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}
string(10) "2147483648"
float(2147483648)
object(DateTime)#2 (3) {
  ["date"]=>
  string(26) "2038-01-19 03:14:08.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}
```


### PHP Version

```plain
>= PHP 8.4
```

### Operating System

32bit environment
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.