[wp-trac] [WordPress Trac] #53635: PHP 8.1: various compatibility fixes

WordPress Trac noreply at wordpress.org
Tue Nov 30 13:50:59 UTC 2021


#53635: PHP 8.1: various compatibility fixes
--------------------------------------------+------------------------------
 Reporter:  SergeyBiryukov                  |       Owner:  hellofromTonya
     Type:  task (blessed)                  |      Status:  accepted
 Priority:  normal                          |   Milestone:  5.9
Component:  General                         |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  php81 has-patch has-unit-tests  |     Focuses:  coding-
                                            |  standards
--------------------------------------------+------------------------------

Comment (by jrf):

 @spacedmonkey Deprecations are not errors and the behaviour of PHP has not
 (yet) changed for these things. The code as-is ''**is**'' compatible with
 PHP 8.1.

 The typical "passing null to non-nullable" deprecations are generally all
 related to (the lack of) input validation/defensive coding. This is
 something which has been plaguing us for years now with PHP increasingly
 getting stricter.

 So rather than making yet more hap-snap ad-hoc fixes, a discussion has
 been started about solving these type of issues in a more structural way
 by introducing input validation in a consistent manner in Core.

 This discussion has only just started and has not reached a conclusion
 yet, but as these are deprecations (not errors), we have time until PHP
 9.0 to have these conversations and solve this properly.
 I'd be very happy for you to join these conversations.


 Please also see my comment about this on Slack:
 https://wordpress.slack.com/archives/C02RQBWTW/p1637194383021500?thread_ts=1637182618.499600&cid=C02RQBWTW

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


More information about the wp-trac mailing list