PHP 8.5 Deprecated Warnings: “Using null as an array offset is deprecated”
-
Hello,
I encountered several PHP 8.5 deprecated warnings while editing posts in WordPress admin.
Environment:
- WordPress: latest version
- PHP: 8.5
- Plugin: Yoast SEO
Warnings:
Deprecated: Using null as an array offset is deprecatedLocations:
wp-content/plugins/wordpress-seo/src/memoizers/meta-tags-context-memoizer.php:135 wp-content/plugins/wordpress-seo/src/memoizers/meta-tags-context-memoizer.php:154 wp-content/plugins/wordpress-seo/src/memoizers/meta-tags-context-memoizer.php:157 wp-content/plugins/wordpress-seo/src/memoizers/presentation-memoizer.php:49 wp-content/plugins/wordpress-seo/src/memoizers/presentation-memoizer.php:63 wp-content/plugins/wordpress-seo/src/memoizers/presentation-memoizer.php:66The warnings appear when opening the post editor:
/wp-admin/post.php?post=XXXX&action=editIt looks like some memoized values may become
nulland are later accessed as arrays without validation.PHP 8.5 now raises deprecation notices for this behavior.
You may want to add stricter null/type checks before accessing array offsets.
Thanks for your work on the plugin.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.