diff --git a/composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php b/composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php
index 3551b80aea5cd273add301e30c572c1143aa0199..f036d7b5b1c0c0eb9826912e32a9a99214f7fff3 100644
--- a/composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php
+++ b/composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php
@@ -115,6 +115,7 @@ protected function checkListHasItemWithContent(array $scaffold_files) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->scaffoldFilesByProject);
   }
diff --git a/core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php8/ReflectionClass.php b/core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php8/ReflectionClass.php
index 015939e147c965ab303a4ebd25373f3b04ec1e07..8781320628577547605fdb21a024a32f83a18d1a 100644
--- a/core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php8/ReflectionClass.php
+++ b/core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php8/ReflectionClass.php
@@ -33,6 +33,7 @@ trait ReflectionClass
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getConstants(?int $filter = null)
     {
         throw new ReflectionException('Method not implemented');
@@ -41,6 +42,7 @@ public function getConstants(?int $filter = null)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function newInstance(mixed ...$args)
     {
         throw new ReflectionException('Method not implemented');
diff --git a/core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionClass.php b/core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionClass.php
index 0f1ff5888d76327f28011db1bbf52550c9672c2f..7abdc86b012c993f54d4715bf6bed55086081824 100644
--- a/core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionClass.php
+++ b/core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionClass.php
@@ -49,6 +49,7 @@ public function __construct(StaticReflectionParser $staticReflectionParser)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getName()
     {
         return $this->staticReflectionParser->getClassName();
@@ -57,6 +58,7 @@ public function getName()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getDocComment()
     {
         return $this->staticReflectionParser->getDocComment();
@@ -65,6 +67,7 @@ public function getDocComment()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getNamespaceName()
     {
         return $this->staticReflectionParser->getNamespaceName();
@@ -81,6 +84,7 @@ public function getUseStatements()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getMethod($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -89,6 +93,7 @@ public function getMethod($name)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getProperty($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -105,6 +110,7 @@ public static function export($argument, $return = false)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getConstant($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -113,6 +119,7 @@ public function getConstant($name)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getConstructor()
     {
         throw new ReflectionException('Method not implemented');
@@ -121,6 +128,7 @@ public function getConstructor()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getDefaultProperties()
     {
         throw new ReflectionException('Method not implemented');
@@ -129,6 +137,7 @@ public function getDefaultProperties()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getEndLine()
     {
         throw new ReflectionException('Method not implemented');
@@ -137,6 +146,7 @@ public function getEndLine()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getExtension()
     {
         throw new ReflectionException('Method not implemented');
@@ -145,6 +155,7 @@ public function getExtension()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getExtensionName()
     {
         throw new ReflectionException('Method not implemented');
@@ -153,6 +164,7 @@ public function getExtensionName()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getFileName()
     {
         throw new ReflectionException('Method not implemented');
@@ -161,6 +173,7 @@ public function getFileName()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getInterfaceNames()
     {
         throw new ReflectionException('Method not implemented');
@@ -169,6 +182,7 @@ public function getInterfaceNames()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getInterfaces()
     {
         throw new ReflectionException('Method not implemented');
@@ -177,6 +191,7 @@ public function getInterfaces()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getMethods($filter = null)
     {
         throw new ReflectionException('Method not implemented');
@@ -185,6 +200,7 @@ public function getMethods($filter = null)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getModifiers()
     {
         throw new ReflectionException('Method not implemented');
@@ -193,6 +209,7 @@ public function getModifiers()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getParentClass()
     {
         throw new ReflectionException('Method not implemented');
@@ -201,6 +218,7 @@ public function getParentClass()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getProperties($filter = null)
     {
         throw new ReflectionException('Method not implemented');
@@ -209,6 +227,7 @@ public function getProperties($filter = null)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getShortName()
     {
         throw new ReflectionException('Method not implemented');
@@ -217,6 +236,7 @@ public function getShortName()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getStartLine()
     {
         throw new ReflectionException('Method not implemented');
@@ -225,6 +245,7 @@ public function getStartLine()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getStaticProperties()
     {
         throw new ReflectionException('Method not implemented');
@@ -233,6 +254,7 @@ public function getStaticProperties()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getStaticPropertyValue($name, $default = '')
     {
         throw new ReflectionException('Method not implemented');
@@ -241,6 +263,7 @@ public function getStaticPropertyValue($name, $default = '')
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getTraitAliases()
     {
         throw new ReflectionException('Method not implemented');
@@ -249,6 +272,7 @@ public function getTraitAliases()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getTraitNames()
     {
         throw new ReflectionException('Method not implemented');
@@ -257,6 +281,7 @@ public function getTraitNames()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function getTraits()
     {
         throw new ReflectionException('Method not implemented');
@@ -265,6 +290,7 @@ public function getTraits()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function hasConstant($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -273,6 +299,7 @@ public function hasConstant($name)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function hasMethod($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -281,6 +308,7 @@ public function hasMethod($name)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function hasProperty($name)
     {
         throw new ReflectionException('Method not implemented');
@@ -289,6 +317,7 @@ public function hasProperty($name)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function implementsInterface($interface)
     {
         throw new ReflectionException('Method not implemented');
@@ -297,6 +326,7 @@ public function implementsInterface($interface)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function inNamespace()
     {
         throw new ReflectionException('Method not implemented');
@@ -305,6 +335,7 @@ public function inNamespace()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isAbstract()
     {
         throw new ReflectionException('Method not implemented');
@@ -313,6 +344,7 @@ public function isAbstract()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isCloneable()
     {
         throw new ReflectionException('Method not implemented');
@@ -321,6 +353,7 @@ public function isCloneable()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isFinal()
     {
         throw new ReflectionException('Method not implemented');
@@ -329,6 +362,7 @@ public function isFinal()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isInstance($object)
     {
         throw new ReflectionException('Method not implemented');
@@ -337,6 +371,7 @@ public function isInstance($object)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isInstantiable()
     {
         throw new ReflectionException('Method not implemented');
@@ -345,6 +380,7 @@ public function isInstantiable()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isInterface()
     {
         throw new ReflectionException('Method not implemented');
@@ -353,6 +389,7 @@ public function isInterface()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isInternal()
     {
         throw new ReflectionException('Method not implemented');
@@ -361,6 +398,7 @@ public function isInternal()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isIterateable()
     {
         throw new ReflectionException('Method not implemented');
@@ -369,6 +407,7 @@ public function isIterateable()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isSubclassOf($class)
     {
         throw new ReflectionException('Method not implemented');
@@ -377,6 +416,7 @@ public function isSubclassOf($class)
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isTrait()
     {
         throw new ReflectionException('Method not implemented');
@@ -385,6 +425,7 @@ public function isTrait()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function isUserDefined()
     {
         throw new ReflectionException('Method not implemented');
@@ -393,6 +434,7 @@ public function isUserDefined()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function newInstanceArgs(array $args = [])
     {
         throw new ReflectionException('Method not implemented');
@@ -401,6 +443,7 @@ public function newInstanceArgs(array $args = [])
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function newInstanceWithoutConstructor()
     {
         throw new ReflectionException('Method not implemented');
@@ -409,6 +452,7 @@ public function newInstanceWithoutConstructor()
     /**
      * {@inheritDoc}
      */
+    #[\ReturnTypeWillChange]
     public function setStaticPropertyValue($name, $value)
     {
         throw new ReflectionException('Method not implemented');
diff --git a/core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php b/core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php
index c6c654f2becc7f140f3ef21c3ac8a531d3934b6b..883b02b3953bbc29a71e73e0016dd4ca21bffd65 100644
--- a/core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php
+++ b/core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php
@@ -33,6 +33,7 @@ public function __construct($path, $regex) {
   /**
    * Implements \FilterIterator::accept().
    */
+  #[\ReturnTypeWillChange]
   public function accept() {
     /** @var \SplFileInfo $file_info */
     $file_info = $this->getInnerIterator()->current();
diff --git a/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php b/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php
index 118631fb2e5ab433b4238f645ec0dfcd2c1b4410..6574c5b3daec9224dcbcffd44990965ac6032c88 100644
--- a/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php
+++ b/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php
@@ -142,6 +142,7 @@ public function removeInstanceId($instance_id) {
     $this->remove($instance_id);
   }
 
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     $instances = [];
     foreach ($this->getInstanceIds() as $instance_id) {
@@ -153,6 +154,7 @@ public function getIterator() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->instanceIds);
   }
diff --git a/core/lib/Drupal/Component/Render/FormattableMarkup.php b/core/lib/Drupal/Component/Render/FormattableMarkup.php
index e26f90e9b8f7cb3557f186660e09f75d2eef39cb..404cf7e6bdc2334170856cd5ad6e55d6b2da55b2 100644
--- a/core/lib/Drupal/Component/Render/FormattableMarkup.php
+++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
@@ -105,6 +105,7 @@ public function __toString() {
    * @return int
    *   The length of the string.
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return mb_strlen($this->string);
   }
@@ -115,6 +116,7 @@ public function count() {
    * @return string
    *   The safe string content.
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return $this->__toString();
   }
diff --git a/core/lib/Drupal/Component/Render/HtmlEscapedText.php b/core/lib/Drupal/Component/Render/HtmlEscapedText.php
index 0ddc4fa4c50060d8c9877977e523fc1f1d2516bb..d5121bfb9f287608fbb6a24188e9c85f5d5e817a 100644
--- a/core/lib/Drupal/Component/Render/HtmlEscapedText.php
+++ b/core/lib/Drupal/Component/Render/HtmlEscapedText.php
@@ -41,6 +41,7 @@ public function __toString() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return mb_strlen($this->string);
   }
@@ -48,6 +49,7 @@ public function count() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return $this->__toString();
   }
diff --git a/core/lib/Drupal/Component/Render/MarkupTrait.php b/core/lib/Drupal/Component/Render/MarkupTrait.php
index c7faa81abae7cd0976b0b0ac290a75ccf8f4107c..93ed4d2eb0da3cf8f4b725a260aa8bcaa3638f46 100644
--- a/core/lib/Drupal/Component/Render/MarkupTrait.php
+++ b/core/lib/Drupal/Component/Render/MarkupTrait.php
@@ -58,6 +58,7 @@ public function __toString() {
    * @return int
    *   The length of the string.
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return mb_strlen($this->string);
   }
@@ -68,6 +69,7 @@ public function count() {
    * @return string
    *   The safe string content.
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return $this->__toString();
   }
diff --git a/core/lib/Drupal/Component/Utility/DeprecatedArray.php b/core/lib/Drupal/Component/Utility/DeprecatedArray.php
index d8483ea68620ff971f0b9b378986bbc6df925fd9..63b5b7f1335042c5e2b27fb3862f2aba61da7491 100644
--- a/core/lib/Drupal/Component/Utility/DeprecatedArray.php
+++ b/core/lib/Drupal/Component/Utility/DeprecatedArray.php
@@ -30,6 +30,7 @@ public function __construct(array $values, $message) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetExists($offset) {
     @trigger_error($this->message, E_USER_DEPRECATED);
     return parent::offsetExists($offset);
@@ -38,6 +39,7 @@ public function offsetExists($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetGet($offset) {
     @trigger_error($this->message, E_USER_DEPRECATED);
     return parent::offsetGet($offset);
@@ -46,6 +48,7 @@ public function offsetGet($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetSet($offset, $value) {
     @trigger_error($this->message, E_USER_DEPRECATED);
     parent::offsetSet($offset, $value);
@@ -54,6 +57,7 @@ public function offsetSet($offset, $value) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetUnset($offset) {
     @trigger_error($this->message, E_USER_DEPRECATED);
     parent::offsetUnset($offset);
@@ -62,6 +66,7 @@ public function offsetUnset($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     @trigger_error($this->message, E_USER_DEPRECATED);
     return parent::getIterator();
@@ -86,6 +91,7 @@ public function serialize() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     @trigger_error($this->message, E_USER_DEPRECATED);
     return parent::count();
diff --git a/core/lib/Drupal/Core/Config/Schema/ArrayElement.php b/core/lib/Drupal/Core/Config/Schema/ArrayElement.php
index b16cee0aeaaa560d98b5621045931c86373baf04..fed16db7d0acce78bdc5b813b5705af148349203 100644
--- a/core/lib/Drupal/Core/Config/Schema/ArrayElement.php
+++ b/core/lib/Drupal/Core/Config/Schema/ArrayElement.php
@@ -114,6 +114,7 @@ public function onChange($name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->getElements());
   }
diff --git a/core/lib/Drupal/Core/Database/Query/Condition.php b/core/lib/Drupal/Core/Database/Query/Condition.php
index 8c5f207f9412e9b274023eb93acca4395e12836b..16793b803403b7518c28922ca6eefd151657aa4b 100644
--- a/core/lib/Drupal/Core/Database/Query/Condition.php
+++ b/core/lib/Drupal/Core/Database/Query/Condition.php
@@ -101,6 +101,7 @@ public function __construct($conjunction, $trigger_deprecation = TRUE) {
    * size of its conditional array minus one, because one element is the
    * conjunction.
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->conditions) - 1;
   }
diff --git a/core/lib/Drupal/Core/Database/Query/InsertTrait.php b/core/lib/Drupal/Core/Database/Query/InsertTrait.php
index f291da1a8103fbe8d86a0cc4ebd713dc774f8e1c..a429c88eead602b8552d4a758db5a77c4ac50883 100644
--- a/core/lib/Drupal/Core/Database/Query/InsertTrait.php
+++ b/core/lib/Drupal/Core/Database/Query/InsertTrait.php
@@ -179,6 +179,7 @@ protected function getInsertPlaceholderFragment(array $nested_insert_values, arr
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->insertValues);
   }
diff --git a/core/lib/Drupal/Core/Database/StatementPrefetch.php b/core/lib/Drupal/Core/Database/StatementPrefetch.php
index 1f2f1709cb7ec10bb4fc27b839e80fe08b207e9d..8c083e37babf49334d5b3b7f099e04c0461f9e5b 100644
--- a/core/lib/Drupal/Core/Database/StatementPrefetch.php
+++ b/core/lib/Drupal/Core/Database/StatementPrefetch.php
@@ -320,6 +320,7 @@ public function setFetchMode($mode, $a1 = NULL, $a2 = []) {
    * @return mixed
    *   The current row formatted as requested.
    */
+  #[\ReturnTypeWillChange]
   public function current() {
     if (isset($this->currentRow)) {
       switch ($this->fetchStyle) {
@@ -379,6 +380,7 @@ public function current() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function key() {
     return $this->currentKey;
   }
@@ -386,6 +388,7 @@ public function key() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function rewind() {
     // Nothing to do: our DatabaseStatement can't be rewound.
   }
@@ -393,6 +396,7 @@ public function rewind() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function next() {
     if (!empty($this->data)) {
       $this->currentRow = reset($this->data);
@@ -407,6 +411,7 @@ public function next() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function valid() {
     return isset($this->currentRow);
   }
diff --git a/core/lib/Drupal/Core/Database/StatementWrapper.php b/core/lib/Drupal/Core/Database/StatementWrapper.php
index 4bef35c22d2ceb8b8d0f21c5548f4f559787a829..2b3eb40f46368e73f0bc6d04c40cb5d0d82eb17d 100644
--- a/core/lib/Drupal/Core/Database/StatementWrapper.php
+++ b/core/lib/Drupal/Core/Database/StatementWrapper.php
@@ -308,6 +308,7 @@ public function fetchAll($mode = NULL, $column_index = NULL, $constructor_argume
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->fetchAll());
   }
diff --git a/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php b/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php
index 2fc17ccc6d120f5b9e06a32de060a581dc7dabb0..c24598689e3c69442bc2cdeace1c5351d6a129b7 100644
--- a/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php
+++ b/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php
@@ -64,6 +64,7 @@ public function __sleep() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function __wakeup() {
     // Tests in isolation potentially unserialize in the parent process.
     $phpunit_bootstrap = isset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index 3e82c6f95f5f4f700ea209535439751c694d90c5..06eefa9106d761e35d5e0f5e9f8043121dfd28f2 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -658,6 +658,7 @@ public function getTranslatableFields($include_computed = TRUE) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->getFields());
   }
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php
index 55a8bba0b988e2216dfb97035248470865e8f94d..a30106029fcb7a8d403f1da26e16b918a071758e 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php
@@ -69,6 +69,7 @@ public function onChange($property_name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     if (isset($this->entity)) {
       return $this->getConfigTypedData()->getIterator();
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
index 3154d1776f8658e5ba68be3686b8668d7f29316a..ddc460ea4e6ec70d434015c144a034fa5b234343 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
@@ -160,6 +160,7 @@ public function applyDefaultValue($notify = TRUE) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return $this->entity instanceof \IteratorAggregate ? $this->entity->getIterator() : new \ArrayIterator([]);
   }
diff --git a/core/lib/Drupal/Core/Entity/Query/ConditionFundamentals.php b/core/lib/Drupal/Core/Entity/Query/ConditionFundamentals.php
index af996a62c1b25cd6e77c9397f728af6d48b22866..e176b68588b6b3db3be119fa393838745933e666 100644
--- a/core/lib/Drupal/Core/Entity/Query/ConditionFundamentals.php
+++ b/core/lib/Drupal/Core/Entity/Query/ConditionFundamentals.php
@@ -65,6 +65,7 @@ public function getConjunction() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->conditions);
   }
diff --git a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php
index 49053dba18073594e041f0f24c24b30686858d20..b61ff4867961145e3d263bed832324101edef4dc 100644
--- a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php
+++ b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php
@@ -115,6 +115,7 @@ public function acceptTests($flag = FALSE) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getChildren() {
     $filter = parent::getChildren();
     // Pass on the skipped folders list.
@@ -127,6 +128,7 @@ public function getChildren() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function accept() {
     $name = $this->current()->getFilename();
     // FilesystemIterator::SKIP_DOTS only skips '.' and '..', but not hidden
diff --git a/core/lib/Drupal/Core/GeneratedLink.php b/core/lib/Drupal/Core/GeneratedLink.php
index 62f10a5df70b53868247c13a8dcd4bf1d060af07..3bb89b8ea80b7731903260b5906912819ab5468e 100644
--- a/core/lib/Drupal/Core/GeneratedLink.php
+++ b/core/lib/Drupal/Core/GeneratedLink.php
@@ -57,6 +57,7 @@ public function __toString() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return $this->__toString();
   }
@@ -64,6 +65,7 @@ public function jsonSerialize() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return mb_strlen($this->__toString());
   }
diff --git a/core/lib/Drupal/Core/Routing/LazyRouteCollection.php b/core/lib/Drupal/Core/Routing/LazyRouteCollection.php
index 5f9706efe7fa2dba330c2d7b7e0ce6562bc595c4..52a716b80a2a4cdd7831e398e1d2d15b7aef4642 100644
--- a/core/lib/Drupal/Core/Routing/LazyRouteCollection.php
+++ b/core/lib/Drupal/Core/Routing/LazyRouteCollection.php
@@ -23,6 +23,7 @@ public function __construct(RouteProviderInterface $provider) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->all());
   }
@@ -33,6 +34,7 @@ public function getIterator() {
    * @return int
    *   The number of routes
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->all());
   }
diff --git a/core/lib/Drupal/Core/Session/SessionHandler.php b/core/lib/Drupal/Core/Session/SessionHandler.php
index eb694921affb431b753bf1699b7e24d281d092d4..420864e6234584e9c76b8ae2b05ca91ecf8aa1cb 100644
--- a/core/lib/Drupal/Core/Session/SessionHandler.php
+++ b/core/lib/Drupal/Core/Session/SessionHandler.php
@@ -46,6 +46,7 @@ public function __construct(RequestStack $request_stack, Connection $connection)
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function open($save_path, $name) {
     return TRUE;
   }
@@ -53,6 +54,7 @@ public function open($save_path, $name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function read($sid) {
     $data = '';
     if (!empty($sid)) {
@@ -67,6 +69,7 @@ public function read($sid) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function write($sid, $value) {
     // The exception handler is not active at this point, so we need to do it
     // manually.
@@ -99,6 +102,7 @@ public function write($sid, $value) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function close() {
     return TRUE;
   }
@@ -106,6 +110,7 @@ public function close() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function destroy($sid) {
     // Delete session data.
     $this->connection->delete('sessions')
@@ -118,6 +123,7 @@ public function destroy($sid) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function gc($lifetime) {
     // Be sure to adjust 'php_value session.gc_maxlifetime' to a large enough
     // value. For example, if you want user sessions to stay in your database
diff --git a/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php b/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php
index fadf29bffdc1cfc8afd254965f59482301ad1c08..d18340d754b7792d8a1dabc97a97c2622f20d3d7 100644
--- a/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php
+++ b/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php
@@ -43,6 +43,7 @@ public function __construct(\SessionHandlerInterface $wrapped_session_handler, $
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function close() {
     return $this->wrappedSessionHandler->close();
   }
@@ -50,6 +51,7 @@ public function close() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function destroy($session_id) {
     return $this->wrappedSessionHandler->destroy($session_id);
   }
@@ -57,6 +59,7 @@ public function destroy($session_id) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function gc($max_lifetime) {
     return $this->wrappedSessionHandler->gc($max_lifetime);
   }
@@ -64,6 +67,7 @@ public function gc($max_lifetime) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function open($save_path, $session_id) {
     return $this->wrappedSessionHandler->open($save_path, $session_id);
   }
@@ -71,6 +75,7 @@ public function open($save_path, $session_id) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function read($session_id) {
     $value = $this->wrappedSessionHandler->read($session_id);
     $this->readSessions[$session_id] = $value;
@@ -80,6 +85,7 @@ public function read($session_id) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function write($session_id, $session_data) {
     // Only write the session when it has been modified.
     if (isset($this->readSessions[$session_id]) && $this->readSessions[$session_id] === $session_data) {
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php b/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php
index dcff3fc3b23169f9f7a2441805685521346f3d66..517bfb2083564a094bf512fc8bd05d1abdc210b2 100644
--- a/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php
+++ b/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php
@@ -224,6 +224,7 @@ protected function getStringTranslation() {
    * @return int
    *   The length of the string.
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return mb_strlen($this->render());
   }
diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php
index cbbe1657f600dd6930337ff0d5a42ca622041c99..1ad25dd9cda8e23ba85738248af7a52c022c4d54 100644
--- a/core/lib/Drupal/Core/Template/Attribute.php
+++ b/core/lib/Drupal/Core/Template/Attribute.php
@@ -90,6 +90,7 @@ public function __construct($attributes = []) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetGet($name) {
     if (isset($this->storage[$name])) {
       return $this->storage[$name];
@@ -99,6 +100,7 @@ public function offsetGet($name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetSet($name, $value) {
     $this->storage[$name] = $this->createAttributeValue($name, $value);
   }
@@ -152,6 +154,7 @@ protected function createAttributeValue($name, $value) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetUnset($name) {
     unset($this->storage[$name]);
   }
@@ -159,6 +162,7 @@ public function offsetUnset($name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetExists($name) {
     return isset($this->storage[$name]);
   }
@@ -352,6 +356,7 @@ public function __clone() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->storage);
   }
@@ -369,6 +374,7 @@ public function storage() {
    * @return string
    *   The safe string content.
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return (string) $this;
   }
diff --git a/core/lib/Drupal/Core/Template/AttributeArray.php b/core/lib/Drupal/Core/Template/AttributeArray.php
index ce7186e46f009b752f1224b454f57168095f69dc..71127f00471d4c32a47e147823a3ac811825bde1 100644
--- a/core/lib/Drupal/Core/Template/AttributeArray.php
+++ b/core/lib/Drupal/Core/Template/AttributeArray.php
@@ -35,6 +35,7 @@ class AttributeArray extends AttributeValueBase implements \ArrayAccess, \Iterat
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetGet($offset) {
     return $this->value[$offset];
   }
@@ -42,6 +43,7 @@ public function offsetGet($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetSet($offset, $value) {
     if (isset($offset)) {
       $this->value[$offset] = $value;
@@ -54,6 +56,7 @@ public function offsetSet($offset, $value) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetUnset($offset) {
     unset($this->value[$offset]);
   }
@@ -61,6 +64,7 @@ public function offsetUnset($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetExists($offset) {
     return isset($this->value[$offset]);
   }
@@ -77,6 +81,7 @@ public function __toString() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->value);
   }
diff --git a/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php b/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php
index f6660c4cca6886bdbaed43f8fc1ae27943107848..18f05b9ea007a0aa55ed4c0746d8eaa3bb462dfc 100644
--- a/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php
+++ b/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php
@@ -126,6 +126,7 @@ public function offsetExists($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     $this->ensureComputedValue();
     return parent::getIterator();
@@ -134,6 +135,7 @@ public function getIterator() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     $this->ensureComputedValue();
     return parent::count();
diff --git a/core/lib/Drupal/Core/TypedData/DataDefinition.php b/core/lib/Drupal/Core/TypedData/DataDefinition.php
index 47010835c87b17b8e360192ad0b07f11ca7d323c..44a8301ef062225540b97eb576fe72b9a749a2df 100644
--- a/core/lib/Drupal/Core/TypedData/DataDefinition.php
+++ b/core/lib/Drupal/Core/TypedData/DataDefinition.php
@@ -301,6 +301,7 @@ public function addConstraint($constraint_name, $options = NULL) {
    * This is for BC support only.
    * @todo: Remove in https://www.drupal.org/node/1928868.
    */
+  #[\ReturnTypeWillChange]
   public function offsetExists($offset) {
     // PHP's array access does not work correctly with isset(), so we have to
     // bake isset() in here. See https://bugs.php.net/bug.php?id=41727.
@@ -313,6 +314,7 @@ public function offsetExists($offset) {
    * This is for BC support only.
    * @todo: Remove in https://www.drupal.org/node/1928868.
    */
+  #[\ReturnTypeWillChange]
   public function &offsetGet($offset) {
     if (!isset($this->definition[$offset])) {
       $this->definition[$offset] = NULL;
@@ -326,6 +328,7 @@ public function &offsetGet($offset) {
    * This is for BC support only.
    * @todo: Remove in https://www.drupal.org/node/1928868.
    */
+  #[\ReturnTypeWillChange]
   public function offsetSet($offset, $value) {
     $this->definition[$offset] = $value;
   }
@@ -336,6 +339,7 @@ public function offsetSet($offset, $value) {
    * This is for BC support only.
    * @todo: Remove in https://www.drupal.org/node/1928868.
    */
+  #[\ReturnTypeWillChange]
   public function offsetUnset($offset) {
     unset($this->definition[$offset]);
   }
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
index 733a4e86d2feb48713355b54cbc64fe3a66264f8..71fa357778d0fe2f9593536fd2d97389ae9748a5 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
@@ -168,6 +168,7 @@ public function first() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetExists($offset) {
     // We do not want to throw exceptions here, so we do not use get().
     return isset($this->list[$offset]);
@@ -176,6 +177,7 @@ public function offsetExists($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetUnset($offset) {
     $this->removeItem($offset);
   }
@@ -183,6 +185,7 @@ public function offsetUnset($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetGet($offset) {
     return $this->get($offset);
   }
@@ -190,6 +193,7 @@ public function offsetGet($offset) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function offsetSet($offset, $value) {
     if (!isset($offset)) {
       // The [] operator has been used.
@@ -229,6 +233,7 @@ public function getItemDefinition() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->list);
   }
@@ -236,6 +241,7 @@ public function getIterator() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->list);
   }
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
index cadebd7d2a1dcd85a4ee36515c8c1d6576078046..72768aa39bdf46f76efe7d1e304704fc48a173d6 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
@@ -181,6 +181,7 @@ public function toArray() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->getProperties());
   }
diff --git a/core/modules/jsonapi/src/JsonApiResource/Data.php b/core/modules/jsonapi/src/JsonApiResource/Data.php
index 61cf72ca4068fee19aae5ef5000024ea14ffd789..0e4006206726ad9da4ac79643fcd00f860a6d0bd 100644
--- a/core/modules/jsonapi/src/JsonApiResource/Data.php
+++ b/core/modules/jsonapi/src/JsonApiResource/Data.php
@@ -69,6 +69,7 @@ public function __construct(array $data, $cardinality = -1) {
    * @return \ArrayIterator
    *   An \ArrayIterator instance
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->data);
   }
@@ -79,6 +80,7 @@ public function getIterator() {
    * @return int
    *   The number of parameters
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->data);
   }
diff --git a/core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php b/core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php
index d43febdd6e38e2f24e26752e82bb4b576cabff7c..018f1920940184d19d36eecab2091fab9e39b6a9 100644
--- a/core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php
+++ b/core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php
@@ -47,6 +47,7 @@ public function __construct(array $errors) {
    * @return \ArrayIterator
    *   An \ArrayIterator instance
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator($this->errors);
   }
diff --git a/core/modules/jsonapi/src/JsonApiResource/LinkCollection.php b/core/modules/jsonapi/src/JsonApiResource/LinkCollection.php
index 3215888693ceaebff64b143de30b3c13a884994d..32ebe6248b44f06b2b175be1dc131b80282d14bc 100644
--- a/core/modules/jsonapi/src/JsonApiResource/LinkCollection.php
+++ b/core/modules/jsonapi/src/JsonApiResource/LinkCollection.php
@@ -62,6 +62,7 @@ public function __construct(array $links, $context = NULL) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     assert(!is_null($this->context), 'A LinkCollection is invalid unless a context has been established.');
     return new \ArrayIterator($this->links);
diff --git a/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php b/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php
index 79b44fc696c9435b8c4acd73a868194bfa7e8804..9b4cc275d1bc88e1d9eddb90c5c4f6fc99720d30 100644
--- a/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php
+++ b/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php
@@ -12,6 +12,7 @@ class TraversableObject implements \IteratorAggregate {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function getIterator() {
     return new \ArrayIterator();
   }
diff --git a/core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php b/core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php
index 41e63d148124df9c3804271162bba024c63ae035..93f8637a564ab417868effad00f3906b28c39e5e 100644
--- a/core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php
+++ b/core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php
@@ -38,6 +38,7 @@ public function getStorageType() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return $this->getSectionList()->count();
   }
diff --git a/core/modules/layout_builder/src/SectionListTrait.php b/core/modules/layout_builder/src/SectionListTrait.php
index 3cb04e0c964705cecbe83b0c2e77caa04c80a6c8..3a2947b99e18691dac56003462c8f56092f47dd2 100644
--- a/core/modules/layout_builder/src/SectionListTrait.php
+++ b/core/modules/layout_builder/src/SectionListTrait.php
@@ -25,6 +25,7 @@ abstract protected function setSections(array $sections);
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     if ($this->hasBlankSection()) {
       return 0;
diff --git a/core/modules/migrate/src/Audit/AuditResult.php b/core/modules/migrate/src/Audit/AuditResult.php
index d5260775e1d461bfdc508f82ef8177f5e77b7249..af0f0961c28ab04287d4fc9040e90cb0bdab8e9e 100644
--- a/core/modules/migrate/src/Audit/AuditResult.php
+++ b/core/modules/migrate/src/Audit/AuditResult.php
@@ -119,6 +119,7 @@ public static function fail(MigrationInterface $migration, array $reasons = [])
    *
    * @see \Drupal\Component\Render\MarkupInterface
    */
+  #[\ReturnTypeWillChange]
   public function count() {
     return count($this->reasons);
   }
@@ -139,6 +140,7 @@ public function __toString() {
    *
    * @return string[]
    */
+  #[\ReturnTypeWillChange]
   public function jsonSerialize() {
     return $this->reasons;
   }
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php b/core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php
index 622ce19e66c29a4185b9a9d306614eb19b55aa1b..1415373eab1092d843d739a9f7d5717a1dc5440d 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php
@@ -181,6 +181,7 @@ public function getQualifiedMapTableName() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function rewind() {
     return NULL;
   }
@@ -188,6 +189,7 @@ public function rewind() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function current() {
     return NULL;
   }
@@ -195,6 +197,7 @@ public function current() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function key() {
     return '';
   }
@@ -202,6 +205,7 @@ public function key() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function next() {
     return NULL;
   }
@@ -209,6 +213,7 @@ public function next() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function valid() {
     return FALSE;
   }
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 3aab791bf22ea05b4c43c1709cd831c49dc89c1d..31dcc222588cf5dedf73cce5292f622cbfc19749 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -887,6 +887,7 @@ public function destroy() {
    *
    * This is called before beginning a foreach loop.
    */
+  #[\ReturnTypeWillChange]
   public function rewind() {
     $this->currentRow = NULL;
     $fields = [];
@@ -908,6 +909,7 @@ public function rewind() {
    *
    * This is called when entering a loop iteration, returning the current row.
    */
+  #[\ReturnTypeWillChange]
   public function current() {
     return $this->currentRow;
   }
@@ -919,6 +921,7 @@ public function current() {
    * current row. It must be a scalar - we will serialize to fulfill the
    * requirement, but using getCurrentKey() is preferable.
    */
+  #[\ReturnTypeWillChange]
   public function key() {
     return serialize($this->currentKey);
   }
@@ -963,6 +966,7 @@ public function currentSource() {
    * This is called at the bottom of the loop implicitly, as well as explicitly
    * from rewind().
    */
+  #[\ReturnTypeWillChange]
   public function next() {
     $this->currentRow = $this->result->fetchAssoc();
     $this->currentKey = [];
@@ -981,6 +985,7 @@ public function next() {
    * This is called at the top of the loop, returning TRUE to process the loop
    * and FALSE to terminate it.
    */
+  #[\ReturnTypeWillChange]
   public function valid() {
     return $this->currentRow !== FALSE;
   }
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
index ffcfe894d5a7ede9af1a6af3108e475c5ba317e3..b79148e3a8ffc6addb563feba9da3efc8f114d29 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
@@ -343,6 +343,7 @@ protected function getIterator() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function current() {
     return $this->currentRow;
   }
@@ -355,6 +356,7 @@ public function current() {
    * serialize to fulfill the requirement, but using getCurrentIds() is
    * preferable.
    */
+  #[\ReturnTypeWillChange]
   public function key() {
     return serialize($this->currentSourceIds);
   }
@@ -365,6 +367,7 @@ public function key() {
    * Implementation of \Iterator::valid() - called at the top of the loop,
    * returning TRUE to process the loop and FALSE to terminate it.
    */
+  #[\ReturnTypeWillChange]
   public function valid() {
     return isset($this->currentRow);
   }
@@ -376,6 +379,7 @@ public function valid() {
    * should implement initializeIterator() to do any class-specific setup for
    * iterating source records.
    */
+  #[\ReturnTypeWillChange]
   public function rewind() {
     $this->getIterator()->rewind();
     $this->next();
@@ -384,6 +388,7 @@ public function rewind() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function next() {
     $this->currentSourceIds = NULL;
     $this->currentRow = NULL;
@@ -486,6 +491,7 @@ public function getCurrentIds() {
    * @return int
    *   The count.
    */
+  #[\ReturnTypeWillChange]
   public function count($refresh = FALSE) {
     if ($this->skipCount) {
       return MigrateSourceInterface::NOT_COUNTABLE;
diff --git a/core/modules/system/tests/modules/session_test/src/Session/TestSessionHandlerProxy.php b/core/modules/system/tests/modules/session_test/src/Session/TestSessionHandlerProxy.php
index 2d2999e335dea9581426a80bce86e5800d73d7dd..a4e28b640a2aeb65c372a728836a761bcecb08e9 100644
--- a/core/modules/system/tests/modules/session_test/src/Session/TestSessionHandlerProxy.php
+++ b/core/modules/system/tests/modules/session_test/src/Session/TestSessionHandlerProxy.php
@@ -37,6 +37,7 @@ public function __construct(\SessionHandlerInterface $session_handler, $optional
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function open($save_path, $name) {
     $trace = \Drupal::service('session_test.session_handler_proxy_trace');
     $trace[] = ['BEGIN', $this->optionalArgument, __FUNCTION__];
@@ -48,6 +49,7 @@ public function open($save_path, $name) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function close() {
     $trace = \Drupal::service('session_test.session_handler_proxy_trace');
     $trace[] = ['BEGIN', $this->optionalArgument, __FUNCTION__];
@@ -59,6 +61,7 @@ public function close() {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function read($session_id) {
     $trace = \Drupal::service('session_test.session_handler_proxy_trace');
     $trace[] = ['BEGIN', $this->optionalArgument, __FUNCTION__, $session_id];
@@ -70,6 +73,7 @@ public function read($session_id) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function write($session_id, $session_data) {
     $trace = \Drupal::service('session_test.session_handler_proxy_trace');
     $trace[] = ['BEGIN', $this->optionalArgument, __FUNCTION__, $session_id];
@@ -81,6 +85,7 @@ public function write($session_id, $session_data) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function destroy($session_id) {
     return $this->sessionHandler->destroy($session_id);
   }
@@ -88,6 +93,7 @@ public function destroy($session_id) {
   /**
    * {@inheritdoc}
    */
+  #[\ReturnTypeWillChange]
   public function gc($max_lifetime) {
     return $this->sessionHandler->gc($max_lifetime);
   }
diff --git a/core/tests/Drupal/Tests/StreamCapturer.php b/core/tests/Drupal/Tests/StreamCapturer.php
index 9b8925723a4197ce59437d424057bbc6d2151ad7..4d71bc7505e35b581129539750db9202418861f6 100644
--- a/core/tests/Drupal/Tests/StreamCapturer.php
+++ b/core/tests/Drupal/Tests/StreamCapturer.php
@@ -9,6 +9,7 @@ class StreamCapturer extends \php_user_filter {
 
   public static $cache = '';
 
+  #[\ReturnTypeWillChange]
   public function filter($in, $out, &$consumed, $closing) {
     while ($bucket = stream_bucket_make_writeable($in)) {
       self::$cache .= $bucket->data;