facebook / facebook/hhvm

DateInterval's properties are not reachable for dynamic inspection (\var_dump(), \print_r(), foreach, etc.)

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

Description

The returned interval is empty but not NULL. The DateInterval object below has no members when it should have a 1 day difference.

```
$date1 = new DateTime("now");
$date2 = new DateTime("tomorrow");
$diff = $date1->diff($date2);
print_r($diff)
```

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.