Bug #76838 [Opn]: date_parse_from_format() changed meaning of zone value in PHP 7.2 -> BC break
| From: | me at vasekpurchart dot cz | Date: | Tue, 04 Sep 2018 18:53:35 +0000 |
| Subject: | Bug #76838 [Opn]: date_parse_from_format() changed meaning of zone value in PHP 7.2 -> BC break | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216883@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76838&edit=1
ID: 76838
User updated by: me at vasekpurchart dot cz
Reported by: me at vasekpurchart dot cz
Summary: date_parse_from_format() changed meaning of zone
value in PHP 7.2 -> BC break
Status: Open
Type: Bug
Package: Date/time related
PHP Version: 7.2.9
Block user comment: N
Private report: N
New Comment:
Sorry, posted slightly different version of test script originally (when I tried to debug if there
are more differences in the parsed result).
Updated:
Test script:
---------------
<?php
// runnable version with results https://3v4l.org/4gtdS
$format = 'Y-m-d\TH:i:sO';
$timeString = '2018-09-04T16:15:55+0200';
$parsedTime = date_parse_from_format($format, $timeString);
var_dump($parsedTime['zone']);
Previous Comments:
------------------------------------------------------------------------
[2018-09-04 15:31:15] me at vasekpurchart dot cz
Description:
------------
In PHP 7.2 the result returned from date_parse_from_format() for
zone parameter differs
in moving from returning value in minutes to seconds and also the positive/negative sign differs.
This is a BC break and should have been at least documented, but I have not found any mention of
this in any of the http://php.net/manual/en/migration72.php links.
Test script:
---------------
<?php
// runnable version with results https://3v4l.org/4vajJ
$format = 'Y-m-d\TH:i:sO';
$timeString = '2018-09-04T16:15:55+0200';
$parsedTime = date_parse_from_format($format, $timeString);
var_dump($parsedTime);
Expected result:
----------------
int(-120)
Actual result:
--------------
int(7200)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76838&edit=1