[php-src] Issue #10228: Invalid DateTime::modify with negative offset in PHP 8.2
Issue: https://github.com/php/php-src/issues/10228
Author: pavol-tuka
### Description
DateTime::modify or DateTimeImmutable::modify in PHP 8.2 returns invalid
result with negative offset.
```php
$now = new DateTimeImmutable(); // 2023-01-05
$offset = -2;
var_dump($now->modify('+' . $offset . '
days')->format('Y-m-d'));
$offset = 2;
var_dump($now->modify('+' . $offset . '
days')->format('Y-m-d'));
```
PHP 8.1.14 output:
```
string(10) "2023-01-03"
string(10) "2023-01-07"
```
PHP 8.2.1 output:
```
string(10) "2023-01-07"
string(10) "2023-01-07"
```
### PHP Version
PHP 8.2.1
### Operating System
Linux Mint 21.1
Thread (1 message)
- pavol-tuka