1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 20:41:18 +02:00
Files
archived-php-src/ext/date/tests/date_time_fractions_serialize.phpt
Derick Rethans 55626549d8 Improve support for microseconds with Date/Time
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.
2016-10-05 15:03:06 -04:00

26 lines
530 B
PHP

--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"
}