strftime has been deprecated #254

Open
opened 6 months ago by ChristopherCormier · 1 comments

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 5 months ago
tslocum referenced this issue from a commit 5 months ago
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 5 months ago
tslocum added the
bug
label 5 months ago
tslocum referenced this issue from a commit 5 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.