php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch trunk-60089-quickfix for Date/time related Bug #60089

Patch version 2011-10-18 21:07 UTC

Return to Bug #60089 | Download this patch
Patch Revisions:

Developer: salathe@php.net

Index: ext/date/tests/bug60089.phpt
===================================================================
--- ext/date/tests/bug60089.phpt	(revision 0)
+++ ext/date/tests/bug60089.phpt	(revision 0)
@@ -0,0 +1,11 @@
+--TEST--
+Bug #60089 (DateTime::createFromFormat() U after u nukes microtime)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+var_dump(DateTime::createFromFormat('u U', '123456 123456790')->format('U u'));
+?>
+
+--EXPECT--
+string(16) "123456790 123456"
Index: ext/date/lib/parse_date.c
===================================================================
--- ext/date/lib/parse_date.c	(revision 318191)
+++ ext/date/lib/parse_date.c	(working copy)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Jun 23 10:58:11 2011 */
+/* Generated by re2c 0.13.5 on Tue Oct 18 22:01:40 2011 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -25014,7 +25014,7 @@
 				s->time->m = 1;
 				s->time->d = 1;
 				s->time->h = s->time->i = s->time->s = 0;
-				s->time->f = 0.0;
+				/* s->time->f deliberately not changed */
 				s->time->relative.s += tmp;
 				s->time->is_localtime = 1;
 				s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
Index: ext/date/lib/parse_date.re
===================================================================
--- ext/date/lib/parse_date.re	(revision 318191)
+++ ext/date/lib/parse_date.re	(working copy)
@@ -2021,7 +2021,7 @@
 				s->time->m = 1;
 				s->time->d = 1;
 				s->time->h = s->time->i = s->time->s = 0;
-				s->time->f = 0.0;
+				/* s->time->f deliberately not changed */
 				s->time->relative.s += tmp;
 				s->time->is_localtime = 1;
 				s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Oct 06 21:05:56 2022 UTC