Bug #73247 [Opn->Csd]: DateTime constructor does not initialise microseconds property

From: Date: Wed, 05 Oct 2016 20:09:42 +0000
Subject: Bug #73247 [Opn->Csd]: DateTime constructor does not initialise microseconds property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204500@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73247&edit=1 ID: 73247 Updated by: derick@php.net Reported by: derick@php.net Summary: DateTime constructor does not initialise microseconds property -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: * PHP Version: 7.1.0RC3 -Assigned To: +Assigned To: derick Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Fixed for PHP 7.1.0 RC4. Previous Comments: ------------------------------------------------------------------------ [2016-10-04 21:02:59] derick@php.net Description: ------------ When initialising the DateTime constructor without specifying the time, the microseconds property isn't initialised. Test script: --------------- <?php $a = new DateTimeImmutable; var_dump($a); ?> Expected result: ---------------- class DateTimeImmutable#1 (3) { public $date => string(26) "2016-09-19 11:20:18.723145" public $timezone_type => int(3) public $timezone => string(13) "Europe/London" } Actual result: -------------- class DateTimeImmutable#1 (3) { public $date => string(26) "2016-09-19 11:20:18.000000" public $timezone_type => int(3) public $timezone => string(13) "Europe/London" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73247&edit=1

« previous php.bugs (#204500) next »