strftime has been deprecated #254

Open
opened 2022-03-05 22:55:25 +00:00 by ChristopherCormier · 1 comment

Since PHP 8.1, all operations print this warning:

Deprecated: Return type of Gettext\Translations::offsetSet($index, $value) should either be compatible with ArrayObject::offsetSet(mixed $key, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /tinyib/inc/gettext/src/Translations.php on line 218

Given that this is a third-party library, it can probably just be rebased on the latest upstream version, or ddde58d420 can be cherrypicked.

Additionally, accessing certain pages like the moderation log prints a deprecation warning regarding strftime(), which was deprecated in PHP 8.1. Some alternatives can be found here: https://github.com/modxcms/revolution/issues/15864

Since PHP 8.1, all operations print this warning: > **Deprecated**: Return type of Gettext\Translations::offsetSet($index, $value) should either be compatible with ArrayObject::offsetSet(mixed $key, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in **/tinyib/inc/gettext/src/Translations.php** on **line 218** Given that this is a third-party library, it can probably just be rebased on the latest upstream version, or https://github.com/php-gettext/Gettext/commit/ddde58d4203f7d832ee8b4eee0b353dd3d8c529e can be cherrypicked. Additionally, accessing certain pages like the moderation log prints a deprecation warning regarding strftime(), which was deprecated in PHP 8.1. Some alternatives can be found here: https://github.com/modxcms/revolution/issues/15864
ChristopherCormier changed title from Deprecation warning in Translations.php with PHP 8.1 to Deprecation warnings with PHP 8.1 2022-03-08 03:40:37 +00:00
tslocum referenced this issue from a commit 2022-03-11 04:36:36 +00:00
Owner

Thanks for your detailed report. It seems like formatting dates with locale support will require adding a new dependency, the intl extension. I am tempted to simply suppress the warning until they remove it, but I will plan on adding a fallback at some point to properly resolve this. PRs are also welcome.

Thanks for your detailed report. It seems like formatting dates with locale support will require adding a new dependency, the [intl](https://www.php.net/manual/en/intl.installation.php) extension. I am tempted to simply suppress the warning until they remove it, but I will plan on adding a fallback at some point to properly resolve this. PRs are also welcome.
tslocum changed title from Deprecation warnings with PHP 8.1 to strftime has been deprecated 2022-03-15 01:36:03 +00:00
tslocum added the
bug
label 2022-03-15 01:42:51 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/tinyib#254
No description provided.