php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72773 php_date_timestamp_set() does not initialize have_date and have_time
Submitted: 2016-08-07 13:34 UTC Modified: 2018-03-18 17:23 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: 5.6Git-2016-08-07 (Git) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2016-08-07 13:34 UTC] 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);



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-12 19:42 UTC] derick@php.net
have_time and have_date are very much internal flags, and should not have been exposed in user land at all.
 [2018-03-18 17:23 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-03-18 17:23 UTC] cmb@php.net
> […] 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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 16:01:29 2024 UTC