facebook / facebook/hhvm

DateTime->diff having issues with leap days

Open
#8,142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version
3.24.2

### Standalone code, or other way to reproduce the problem
```php
diff($a)->y);

date_default_timezone_set('Europe/Amsterdam');

$d = new DateTime('2008-03-01');
$a = new DateTime('2018-03-01');

var_dump($d->diff($a)->y);
```

### Expected result

```
int(10)
int(10)
```

### Actual result

```
int(10)
int(9)
```

PHP bug report: https://bugs.php.net/bug.php?id=76032

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.