跳到内容 跳到侧边栏

本主题包含 0 則回覆 ,有 0 声音 。

最后由 mirteM 2 weeks, 3 days前 更新。

协助者:: Maiya AI Support.

作者 帖子
30 12 月, 2025 于 5:49 下午 #17697274

mirteM

Hello WPML Team,

I recently upgraded my server environment to PHP 8.4. Since the upgrade, I am seeing a significant number of E_DEPRECATED notices in my debug.log.

The site functionality appears to be fine, but the logs are filling up rapidly with the same type of error across WPML Core, String Translation, and Media Translation.

The Issue:
PHP 8.4 no longer allows implicitly marking parameters as nullable. Explicit nullable types (e.g., ?string $param instead of just $param = null) must be used.

Environment:
PHP Version: 8.4.16
WPML Multilingual CMS: 4.8.6
WPML String Translation: 3.4.1
WordPress: 6.9

Sample Log Entries:
Here are the most frequent errors appearing in the logs:
1. Twig / Core:
PHP Deprecated: WPML\Core\Twig\Node\IfNode::__construct(): Implicitly marking parameter $else as nullable is deprecated, the explicit nullable type must be used instead in .../plugins/sitepress-multilingual-cms/lib/twig/src/Node/IfNode.php on line 22
2. Core Functions:
PHP Deprecated: wpml_sticky_post_sync(): Implicitly marking parameter $sitepress as nullable is deprecated in .../plugins/sitepress-multilingual-cms/inc/functions.php on line 821
3. Dependency Injection (Auryn):
PHP Deprecated: WPML\Auryn\Injector::__construct(): Implicitly marking parameter $reflector as nullable is deprecated in .../plugins/sitepress-multilingual-cms/vendor/otgs/auryn/lib/Injector.php on line 51
4. String Translation:
PHP Deprecated: WPML\ST\MO\Hooks\CustomTextDomains::__construct(): Implicitly marking parameter $syncMissingFile as nullable is deprecated in .../plugins/wpml-string-translation/classes/MO/Hooks/CustomTextDomains.php on line 42

I wanted to report this so your development team can address these strict typing requirements in the next release to ensure full PHP 8.4 compatibility.

Thank you!

主题'[關閉] Extensive PHP 8.4 Deprecation Notices (Implicitly nullable parameters) (opened again)'已关闭,不接受新回复。