Bug #72773 [Opn->Csd]: php_date_timestamp_set() does not initialize have_date and have_time

From: Date: Sun, 18 Mar 2018 17:23:09 +0000
Subject: Bug #72773 [Opn->Csd]: php_date_timestamp_set() does not initialize have_date and have_time
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214399@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72773&edit=1 ID: 72773 Updated by: cmb@php.net Reported by: cmb@php.net Summary: php_date_timestamp_set() does not initialize have_date and have_time -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: * PHP Version: 5.6Git-2016-08-07 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: > […] and should not have been exposed in user land at all. They have not been exposed to userland, so presumably, everything is fine. Sorry for the noise. Previous Comments: ------------------------------------------------------------------------ [2017-02-12 19:42:29] derick@php.net have_time and have_date are very much internal flags, and should not have been exposed in user land at all. ------------------------------------------------------------------------ [2016-08-07 14:11:04] cmb@php.net Related To: Bug #48225 ------------------------------------------------------------------------ [2016-08-07 13:34:45] cmb@php.net Description: ------------ php_date_timestamp_set()[1] does not properly initialize the have_date and have_time members of the timelib_time struct. Both should be 1, but actually are 0. The supplied test script reveals this behavior in the debugger only. I'm not sure whether this should be fixed in php_date_timestamp_set(), or rather in timelib_update_ts() or maybe initializetimelib_unixtime2local(). [1] <https://github.com/php/php-src/blob/PHP-7.0.10/ext/date/php_date.c#L3503-L3511> Test script: --------------- <?php date_timestamp_set(date_create(), 1); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72773&edit=1

« previous php.bugs (#214399) next »