xref: /PHP-8.0/ext/date/tests/bug66836.phpt (revision 966311e6)
1--TEST--
2Bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails parsing)
3--INI--
4date.timezone=Europe/Berlin
5--FILE--
6<?php
7foreach (['-1', '-86400', '-1000000'] as $timestamp) {
8    $dt = DateTime::createFromFormat('U', $timestamp);
9    var_dump($dt->format('U') === $timestamp);
10}
11?>
12--EXPECT--
13bool(true)
14bool(true)
15bool(true)
16