Bug #72773 [NEW]: php_date_timestamp_set() does not initialize have_date and have_time
| From: | cmb@php.net | Date: | Sun, 07 Aug 2016 13:34:46 +0000 |
| Subject: | Bug #72773 [NEW]: php_date_timestamp_set() does not initialize have_date and have_time | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203032@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: *
PHP version: 5.6Git-2016-08-07 (Git)
Package: Date/time related
Bug Type: Bug
Bug description:php_date_timestamp_set() does not initialize have_date and have_time
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 bug report at https://bugs.php.net/bug.php?id=72773&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72773&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72773&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72773&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72773&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72773&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72773&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72773&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72773&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72773&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72773&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72773&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72773&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72773&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72773&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72773&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72773&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72773&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72773&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72773&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72773&r=mysqlcfg