On Fri, May 19, 2023, at 8:49 PM, Jorg Sowa wrote:
> Hello everyone,
>
> I would like to propose the deprecation of the constants DATE_ISO8601,
> DateTimeInterface::ISO8601 and DateTimeInterface::RFC7231, DATE_RFC7231.
>
> Arguments for deprecating DATE_ISO8601:
> - outdated format, standard has been changed while ago
> - incompatible with format ISO8601_EXPANDED
> - misleading behavior for developers [1]
> <https://stackoverflow.com/questions/38252867/what-is-the-right-iso8601-format>
> [2]
> <https://stackoverflow.com/questions/8003446/php-validate-iso-8601-date-string>
> - doesn't support microseconds [3] 
> <https://bugs.php.net/bug.php?id=51950>
> - many misunderstandings in the userland [4]
> <https://api.drupal.org/api/drupal/includes%21common.inc/function/date_iso8601/7.x>
> [5] <https://carbon.nesbot.com/docs/#api-commonformats>
>
> In my opinion the question is not whether this constant should be
> deprecated, but when. I know that the problem was discussed in the past,
> but I hope enough time has passed already to touch this topic again
> although of the BC nature. [6] <https://externals.io/message/113657#114885>
> [7]
>
> <https://www.reddit.com/r/PHP/comments/hnd438/why_isnt_date_iso8601_deprecated/>
> Arguments for deprecating DATE_RFC7231:
> - error prone nature, the format never really supported timezone. I'm not
> sure how it appeared in the code, but tests clearly lack cases for this
> format. I'm not sure if it was missed on purpose, but with tests it would
> be obvious that the format shouldn't ever appear in the core. [8]
> <https://www.php.net/manual/en/class.datetimeinterface.php> [9]
> <https://github.com/php/doc-en/pull/2296>
>
> It's my first proposition in the PHP Core and I'm not sure if I should
> suggest it through RFC or normal discussion like this. If I should propose
> it in RFC then I can prepare it along with PR.
>
> Kind regards,
> Jorg

How common is it in the wild?  I am pretty sure I've used it myself without 
really thinking many times, which I suspect is common.  Knowing how much code 
would be impacted would determine how we'd go about deprecating it and on what 
timeline.

--Larry Garfield

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to