Bug #72773 [Opn]: php_date_timestamp_set() does not initialize have_date and have_time
| From: | derick@php.net | Date: | Sun, 12 Feb 2017 19:42:32 +0000 |
| Subject: | Bug #72773 [Opn]: 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-207294@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: derick@php.net
Reported by: cmb@php.net
Summary: php_date_timestamp_set() does not initialize
have_date and have_time
Status: Open
Type: Bug
Package: Date/time related
Operating System: *
PHP Version: 5.6Git-2016-08-07 (Git)
Block user comment: N
Private report: N
New Comment:
have_time and have_date are very much internal flags, and should not have been exposed in user land
at all.
Previous Comments:
------------------------------------------------------------------------
[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