diff options
author | Derick Rethans <github@derickrethans.nl> | 2016-10-05 11:24:15 -0400 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2016-10-05 15:03:06 -0400 |
commit | 55626549d81d0feadb1d160be78fcf2b898a48cc (patch) | |
tree | a00c6239804f2ad68ccc3470e63e83eb18f7897f /ext/date/tests/date_time_fractions_serialize.phpt | |
parent | d5b77d66626b138a83b6c0d16f746893fefa29ee (diff) | |
download | php-git-microseconds.tar.gz |
Improve support for microseconds with Date/Timemicroseconds
It fixes several bugs:
- Fixed bug #45554 (Inconsistent behavior of the u format char).
- Fixed bug #48225 (DateTime parser doesn't set microseconds for "now").
- Fixed bug #52514 (microseconds are missing in DateTime class).
- Fixed bug #52519 (microseconds in DateInterval are missing).
- Fixed bug #68506 (General DateTime improvments needed for microseconds to become useful).
- Fixed bug #73109 (timelib_meridian doesn't parse dots correctly).
- Fixed bug #73247 (DateTime constructor does not initialise microseconds property).
It also updates timelib to 2016.04, and updates a data mapping file, which
causes changes to the volatile abbreviations tests.
Diffstat (limited to 'ext/date/tests/date_time_fractions_serialize.phpt')
-rw-r--r-- | ext/date/tests/date_time_fractions_serialize.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/date/tests/date_time_fractions_serialize.phpt b/ext/date/tests/date_time_fractions_serialize.phpt new file mode 100644 index 0000000000..4931bb02b3 --- /dev/null +++ b/ext/date/tests/date_time_fractions_serialize.phpt @@ -0,0 +1,25 @@ +--TEST-- +Fractions with DateTime objects (Serialization) +--INI-- +date.timezone=UTC +--FILE-- +<?php +/* Normal creation */ +$dt = date_create( "2016-10-03 12:47:18.819313" ); + +$s = serialize( $dt ); +echo $s, "\n"; + +$u = unserialize( $s ); +var_dump( $u ); +?> +--EXPECTF-- +O:8:"DateTime":3:{s:4:"date";s:26:"2016-10-03 12:47:18.819313";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";} +object(DateTime)#2 (%d) { + ["date"]=> + string(26) "2016-10-03 12:47:18.819313" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} |