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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 - 28 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 20 05:01:27 2024 UTC