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
e raised the same issue on the list here.) This one might be a minor
detail, but don't details matter?
No matter the outcome I would still add this comment to the bug report. It
will help other users.
Thanks for your feedback!