Commit e7697eb5c87 for woocommerce
commit e7697eb5c8797b5017c6f22d3902a58ab3d172b7
Author: Kadir Er <3rkadir@gmail.com>
Date: Wed Nov 25 14:27:53 2026 +0300
Fix method to check session existence in baseline hashes (#71353)
* Fix method to check session existence in baseline hashes
Replace deprecated SplObjectStorage::contains() call
Fix PHP 8.5 deprecation in SessionConcurrencyGuard.
* Fix session guard indentation
* Add changelog for PHP 8.5 session guard fix
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/fix-71224-php-85-session-guard-deprecation b/plugins/woocommerce/changelog/fix-71224-php-85-session-guard-deprecation
new file mode 100644
index 00000000000..0c62fa20d71
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-71224-php-85-session-guard-deprecation
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Avoid a PHP 8.5 deprecation when checking whether Store API session state changed during checkout.
diff --git a/plugins/woocommerce/src/StoreApi/Utilities/SessionConcurrencyGuard.php b/plugins/woocommerce/src/StoreApi/Utilities/SessionConcurrencyGuard.php
index fbbc7d73486..0564be11f73 100644
--- a/plugins/woocommerce/src/StoreApi/Utilities/SessionConcurrencyGuard.php
+++ b/plugins/woocommerce/src/StoreApi/Utilities/SessionConcurrencyGuard.php
@@ -42,7 +42,7 @@ final class SessionConcurrencyGuard {
public static function has_changed( WC_Session $session ): bool {
$baseline_hashes = self::get_baseline_hashes();
- if ( ! $baseline_hashes->contains( $session ) ) {
+ if ( ! $baseline_hashes->offsetExists( $session ) ) {
return false;
}