When using WPML + Yoast SEO + WPML SEO Multilingual (wp-seo-multilingual), a PHP 8.1+ deprecation notice is triggered on every page load:
PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated
in /wp-includes/formatting.php on line 4496
Root cause:
Yoast SEO generates breadcrumb schema data (JSON-LD) for every page. The last breadcrumb item (the current page) intentionally has a null URL, since it is not a link.
The WPML SEO Multilingual plugin (wp-seo-multilingual) hooks into wpseo_breadcrumb_links via WPMLWPSEOYoastSEOPresentationHooks::translateBreadcrumbs() (Hooks.php, line 151) and calls apply_filters('wpml_permalink', $url) for each breadcrumb URL — including the null one.
The WPML core handler WPML_API_Hook_Permalink::wpml_permalink_filter() in class-wpml-api-hook-permalink.php (line 40) then calls esc_url_raw($url) without checking if $url is null, which triggers the deprecation.