[wp-trac] [WordPress Trac] #54428: PHP8.1 deprecation warnings

WordPress Trac noreply at wordpress.org
Fri Nov 12 20:32:32 UTC 2021


#54428: PHP8.1 deprecation warnings
-------------------------------------+------------------------------
 Reporter:  michaing                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback php81  |     Focuses:
-------------------------------------+------------------------------

Comment (by michaing):

 Issues observed on latest WordPress v5.8.2. The second one has been fixed
 already in unreleased upstream code, the first is a declaration issue in
 the core code, hence not related to any plugin or theme:
 - https://github.com/WordPress/WordPress/blob/master/wp-
 includes/Requests/Utility/CaseInsensitiveDictionary.php#L15
 - https://github.com/WordPress/WordPress/blob/master/wp-
 includes/Requests/Cookie/Jar.php#L15
 These classes implement `IteratorAggregate` and `ArrayAccess` APIs:
 - https://www.php.net/manual/en/class.arrayaccess.php
 - https://www.php.net/manual/en/class.iteratoraggregate.php

 And the return type definitions do not match for all contained functions.
 It seems to be even `boolean` vs `bool` in the API is seen as difference
 here. But in some cases they are indeed different, e.g. `offsetGet` with
 `string|null` vs `mixed` in the API.

 I think I can send a PR to have this fixed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54428#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list