Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#57738 closed defect (bug) (duplicate)

PHP 8.1 Depreciated

Reported by: rtacorp's profile rtacorp Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: External Libraries Keywords: php81
Focuses: Cc:

Description (last modified by sabernhardt)

Hi, Getting PHP 8.1.9 deprecated notices in the debug.log which you might wish to correct for the next version of WordPress. Here are the to files to be corrected:

  • /wp-includes/Requests/Cookie/Jar.php
  • /wp-includes/Requests/Utility/CaseInsensitiveDictionary.php

Thanks.

[16-Feb-2023 18:59:56 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Cookie/Jar.php on line 63
[16-Feb-2023 18:59:56 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Cookie/Jar.php on line 73
[16-Feb-2023 18:59:56 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Cookie/Jar.php on line 89
[16-Feb-2023 18:59:56 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Cookie/Jar.php on line 102
[16-Feb-2023 18:59:56 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Cookie/Jar.php on line 111
[16-Feb-2023 18:59:57 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40
[16-Feb-2023 18:59:57 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51
[16-Feb-2023 18:59:57 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68
[16-Feb-2023 18:59:57 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82
[16-Feb-2023 18:59:57 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91

Change History (3)

#1 @hellofromTonya
15 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hello @rtacorp,

Welcome to Core Trac. Thank you for reporting.

These deprecations are due to the Requests 1.x version which was not compatible with PHP 8+. Requests 2.0 was committed in #54504 / [54997], which resolves these deprecation notices. This will ship with WordPress 6.2.

#2 @hellofromTonya
15 months ago

  • Component changed from General to External Libraries
  • Version 6.1.1 deleted

#3 @sabernhardt
15 months ago

  • Description modified (diff)
  • Keywords php81 added
Note: See TracTickets for help on using tickets.