diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
|---|---|---|
| committer | <> | 2013-04-03 16:25:08 +0000 |
| commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
| tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/date/tests/bug52062.phpt | |
| download | php2-master.tar.gz | |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/date/tests/bug52062.phpt')
| -rw-r--r-- | ext/date/tests/bug52062.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt new file mode 100644 index 0000000..1d81437 --- /dev/null +++ b/ext/date/tests/bug52062.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimestamp) (32 bit) +--SKIPIF-- +<?php +if (PHP_INT_SIZE == 8) die('skip 32-bit only'); +?> +--XFAIL-- +Waiting for resolution of the 32-bit case. +--INI-- +date.timezone=UTC +--FILE-- +<?php +$d = new DateTime('@100000000000'); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); +var_dump($d->format('U')); + +$d->setTimestamp(100000000000); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$i = new DateInterval('PT100000000000S'); +var_dump($i->format('%s')); +?> +--EXPECT-- +string(32) "5138-11-16 09:46:40 100000000000" +bool(false) +string(12) "100000000000" +string(30) "2008-07-11 04:56:32 1215752192" +int(1215752192) +string(10) "1215752192" |
