Bug #66156
| From: | Matt Pelmear | Date: | Sun, 24 Nov 2013 19:10:24 +0000 |
| Subject: | Bug #66156 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-70357@lists.php.net to get a copy of this message | ||
Evidently I've not been clear enough in my bug ticket #66156 (https://bugs.php.net/bug.php?id=66156) so I'll bring it to the group here.
In Derick's comment (while marking this as "not a bug") he stated that "If you pass in an ambiguous string for a format, there is nothing we can do."
I agree completely. However, "!ndY" is *not* ambiguous. I think the ticket was just misread, since he mentioned "!jnY" specifically in his comment.
"!ndY" is a one or two digit number, followed by a two digit number, followed by a four digit number.
To use Derick's example, "1112013", when parsed with "!ndY", should be unambiguously January 11th, 2013 (because the date *must be* two digits, due to the use of "d").
There is no case that is ambiguous with this format, unless you are only thinking about parsing it from left-to-right. That doesn't make the format ambiguous; that just makes it incompatible with the current algorithm, which is fine.
All I'm suggesting is that if we don't plan to support this *unambiguous* date format properly (because of the effort involved in doing so), we should have an error message that indicates such a decision, as opposed to simply receiving bad output for a format that should work, regardless of how strange it is.
At the very least the official documentation should indicate that the algorithm always works from left to right, and as such could have unexpected results in some fringe cases. Maybe that is the best solution.
I've offered to do the work. I'm just looking for an agreement that an error message returned in the standard format for that method is acceptable.
I apologize for the degree of frustration here, but this is the second time I've submitted a ticket that was a real issue but was misread and dismissed. (The other issue was fixed afterward, when someone else raised the same issue on the list here.) This one might be a minor detail, but don't details matter?
-Matt