Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56612 closed defect (bug) (duplicate)

PHP 8.1.10 bug Core WP Deprecated errors

Reported by: egamestudio's profile egamestudio Owned by:
Milestone: Priority: normal
Severity: trivial Version: 6.0.2
Component: Administration Keywords: php81
Focuses: Cc:

Description

Hi,
I have a website with latest version 6.0.2 and PHP 8.1.10 and i receive this error in backend/frontend :

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 /public_html/wp-includes/Requests/Cookie/Jar.php> on line 63

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 /public_html/wp-includes/Requests/Cookie/Jar.php on line 111

And many more

Change History (3)

This ticket was mentioned in PR #3301 on WordPress/wordpress-develop by thejaydip.


2 years ago
#1

  • Keywords has-patch added

Check non-empty variable before return may be it will work.

Trac ticket: https://core.trac.wordpress.org/ticket/56612

#2 @jrf
2 years ago

  • Keywords php81 added; has-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Severity changed from critical to trivial
  • Status changed from new to closed

Duplicate of #54504.

@egamestudio Thanks for reporting, but this is a known issue and under discussion in #54504.

Note: the patch which has been associated with this ticket is unrelated to this ticket.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#3 @iamjaydip
2 years ago

Display this kind of error with the latest WordPress 6.0.2 and PHP 8.1.10. Please find the attachment for more clarification.

https://prnt.sc/Lc998qyr1hqQ

Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wordpress/project/wp-developer/wp-includes/formatting.php on line 2772
Note: See TracTickets for help on using tickets.