PHP 8.1 Return type of DeprecatedArray::unserialize() and ::serialize()

Created on 31 May 2022, over 2 years ago
Updated 17 February 2023, over 1 year ago

Problem/Motivation

Deprecated: Return type of Drupal\Component\Utility\DeprecatedArray::unserialize($serialized) should either be compatible with ArrayObject::unserialize(string $data): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./core/lib/Drupal/Component/Utility/DeprecatedArray.php on line 78

Deprecated: Return type of Drupal\Component\Utility\DeprecatedArray::serialize() should either be compatible with ArrayObject::serialize(): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./core/lib/Drupal/Component/Utility/DeprecatedArray.php on line 86

Steps to reproduce

A simple page load or php -l core/lib/Drupal/Component/Utility/DeprecatedArray.php

Proposed resolution

Annotate methods with #[\ReturnTypeWillChange].

πŸ“Œ Task
Status

Fixed

Version

9.5

Component
OtherΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡­πŸ‡ΊHungary Sweetchuck Budapest

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024