Bug #50020 [ReO->Csd]: DateInterval:createDateFromString() silently fails
| From: | derick@php.net | Date: | Thu, 28 Feb 2019 14:02:19 +0000 |
| Subject: | Bug #50020 [ReO->Csd]: DateInterval:createDateFromString() silently fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219764@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50020&edit=1
ID: 50020
Updated by: derick@php.net
Reported by: jennifer dot kimball at nrc dot ca
Summary: DateInterval:createDateFromString() silently fails
-Status: Re-Opened
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: Solaris 10
PHP Version: 5.3.0
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2018-07-27 11:13:54] requinix@php.net
The memory problem is gone but there's still no way to detect failure - error information
generated when processing the string is discarded and should be used to decide whether to return
false.
------------------------------------------------------------------------
[2018-07-27 11:06:23] nyamsprod at gmail dot com
var_dump(date_interval_create_from_date_string('foobar') == new
DateInterval('PT0S'));
I would expect date_interval_create_from_date_string to return false
I would expect DateInterval::createFromDateString to return null or to throw an Exception.
Currently you cannot distinguish between a DateInterval with 0s duration and a failed parsing of the
duration string.
------------------------------------------------------------------------
[2014-12-30 10:41:36] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2014-04-24 10:13:02] datibbaw@php.net
Sorry, I somehow missed the comment thread (was looking at the wrong tab) ;-)
------------------------------------------------------------------------
[2014-04-24 10:09:39] datibbaw@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Couldn't reproduce the memory issue from 5.3.0 onwards: http://3v4l.org/kPMor
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=50020
--
Edit this bug report at https://bugs.php.net/bug.php?id=50020&edit=1