Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.2: utf8_decode(..) emit tons of deprecated warnings to the log = serious performance impact #153

Open
Jemt opened this issue Jun 16, 2024 · 1 comment

Comments

@Jemt
Copy link
Owner

Jemt commented Jun 16, 2024

A huge amount of deprecation warnings are logged on PHP 8.2:

Error 8192: Function utf8_decode() is deprecated

Sure enough, utf8_decode(..) was deprecated with PHP 8.2: https://www.php.net/manual/en/function.utf8-decode.php

This function has been DEPRECATED as of PHP 8.2.0. Relying on this function is highly discouraged.

In my particular case the website's response time goes from ~200 ms to 3000-4000 seconds, when using MySQL as the database, where the deprecated error is logged 1012 times for each page load.

For a website using XML as the database, it is likely that the website will become unresponsive once the SMLog.xml.php file reaches a certain size, which will probably happen soon after upgrading to PHP 8.2.

@Jemt
Copy link
Owner Author

Jemt commented Jun 16, 2024

Ugly work around: Disable error logging by disabling the selected line:

image

The PHP folks have been kind enough to ensure that the call to utf8_decode(..) within the error handler does not cause an infinite loop, it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant