diff options
-rw-r--r-- | ext/date/tests/bug66836.phpt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/date/tests/bug66836.phpt b/ext/date/tests/bug66836.phpt new file mode 100644 index 0000000000..8fab7837ea --- /dev/null +++ b/ext/date/tests/bug66836.phpt @@ -0,0 +1,15 @@ +--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) |