Adding strtotime change to migration document

php.internals

Christian Schneider

3 years ago
While migrating to PHP 8.2 we noticed the change in strtotime. PHP <= 8.1 supported "today +- 3 days" etc. but the support for multiple sign characters (++, --, -+, +-) has been removed in 8.2: https://3v4l.org/mHa3t This was discussed at https://github.com/php/php-src/issues/9950#issuecomment-1314101723 I understand the reasoning to remove support even though I liked the flexibility but as this is a small BC break I was wondering if it should be added to the migration document for 8.2. Regards, - Chris

Christoph Becker

3 years ago
On 11.01.2023 at 14:07, Christian Schneider wrote:
> While migrating to PHP 8.2 we noticed the change in strtotime. > PHP <= 8.1 supported "today +- 3 days" etc. but the support for multiple sign characters (++, --, -+, +-) has been removed in 8.2: > https://3v4l.org/mHa3t > > This was discussed at > https://github.com/php/php-src/issues/9950#issuecomment-1314101723 > > I understand the reasoning to remove support even though I liked the flexibility but as this is a small BC break I was wondering if it should be added to the migration document for 8.2.
Given that PHP itself has no problems with this (<https://3v4l.org/8WBEj>), I think a changelog entry is appropriate. Maybe you want to provide a respective PR?
-- Christoph M. Becker

Christian Schneider

3 years ago
Am 11.01.2023 um 15:04 schrieb Christoph M. Becker <cmbecker69@gmx.de>:
> On 11.01.2023 at 14:07, Christian Schneider wrote: > >> While migrating to PHP 8.2 we noticed the change in strtotime. >> PHP <= 8.1 supported "today +- 3 days" etc. but the support for multiple sign characters (++, --, -+, +-) has been removed in 8.2: >> https://3v4l.org/mHa3t >> >> This was discussed at >> https://github.com/php/php-src/issues/9950#issuecomment-1314101723 >> >> I understand the reasoning to remove support even though I liked the flexibility but as this is a small BC break I was wondering if it should be added to the migration document for 8.2. > > Given that PHP itself has no problems with this > (<https://3v4l.org/8WBEj>), I think a changelog entry is appropriate. > Maybe you want to provide a respective PR?
I'm not familiar with the changelog / migration document handling but my preferred place would be a line in the migration document so people checking what they have to look out for hopefully see it. I don't think people read the full changelogs. - Chris

Christoph Becker

3 years ago
On 11.01.2023 at 15:19, Christian Schneider wrote:
> Am 11.01.2023 um 15:04 schrieb Christoph M. Becker <cmbecker69@gmx.de>: >> On 11.01.2023 at 14:07, Christian Schneider wrote: >> >>> While migrating to PHP 8.2 we noticed the change in strtotime. >>> PHP <= 8.1 supported "today +- 3 days" etc. but the support for multiple sign characters (++, --, -+, +-) has been removed in 8.2: >>> https://3v4l.org/mHa3t >>> >>> This was discussed at >>> https://github.com/php/php-src/issues/9950#issuecomment-1314101723 >>> >>> I understand the reasoning to remove support even though I liked the flexibility but as this is a small BC break I was wondering if it should be added to the migration document for 8.2. >> >> Given that PHP itself has no problems with this >> (<https://3v4l.org/8WBEj>), I think a changelog entry is appropriate. >> Maybe you want to provide a respective PR? > > I'm not familiar with the changelog / migration document handling but my preferred place would be a line in the migration document so people checking what they have to look out for hopefully see it. I don't think people read the full changelogs.
Documented as <https://github.com/php/doc-en/commit/cf220d0944b207510abb5e3c7c262140b8ac082c>.
-- Christoph M. Becker

Christian Schneider

3 years ago
Am 11.01.2023 um 17:09 schrieb Christoph M. Becker <cmbecker69@gmx.de>:
> On 11.01.2023 at 15:19, Christian Schneider wrote: > >> Am 11.01.2023 um 15:04 schrieb Christoph M. Becker <cmbecker69@gmx.de>: >>> On 11.01.2023 at 14:07, Christian Schneider wrote: >>> >>>> While migrating to PHP 8.2 we noticed the change in strtotime. >>>> PHP <= 8.1 supported "today +- 3 days" etc. but the support for multiple sign characters (++, --, -+, +-) has been removed in 8.2: >>>> https://3v4l.org/mHa3t >>>> >>>> This was discussed at >>>> https://github.com/php/php-src/issues/9950#issuecomment-1314101723 >>>> >>>> I understand the reasoning to remove support even though I liked the flexibility but as this is a small BC break I was wondering if it should be added to the migration document for 8.2. >>> >>> Given that PHP itself has no problems with this >>> (<https://3v4l.org/8WBEj>), I think a changelog entry is appropriate. >>> Maybe you want to provide a respective PR? >> >> I'm not familiar with the changelog / migration document handling but my preferred place would be a line in the migration document so people checking what they have to look out for hopefully see it. I don't think people read the full changelogs. > > Documented as > <https://github.com/php/doc-en/commit/cf220d0944b207510abb5e3c7c262140b8ac082c>.
Two little comments: - It not only concerns a plus sign after a minus sign but all sign combinations ++, --, +- and -+ - It also concerns strtotime(), I think this could be mentioned too Regards, - Chris

Christoph Becker

3 years ago
On 13.01.2023 at 09:11, Christian Schneider wrote:
> Two little comments: > - It not only concerns a plus sign after a minus sign but all sign combinations ++, --, +- and -+
Fixed with <https://github.com/php/doc-en/commit/ef51b1ce007349e7ff415ec5c707f1b5a73aba27>.
> - It also concerns strtotime(), I think this could be mentioned too
This is already documented: | This section describes all the different formats that the | DateTimeImmutable, DateTime, date_create_immutable(), date_create(), | date_parse(), and strtotime() parser understands.
-- Christoph M. Becker