php-src/ext/date/tests/bug66836.phpt
2016-07-11 16:06:35 +02:00

16 lines
344 B
PHP

--TEST--
Bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails parsing)
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
foreach (['-1', '-86400', '-1000000'] as $timestamp) {
$dt = DateTime::createFromFormat('U', $timestamp);
var_dump($dt->format('U') === $timestamp);
}
?>
--EXPECT--
bool(true)
bool(true)
bool(true)