[wp-trac] [WordPress Trac] #58772: PHP 8.1 - PHP Deprecated: strpos(): /wp-includes/functions.php on line 7053 PHP Deprecated: str_replace(): /wp-includes/functions.php on line 2165

WordPress Trac noreply at wordpress.org
Mon Jul 10 17:45:54 UTC 2023


#58772: PHP 8.1 - PHP Deprecated: strpos(): /wp-includes/functions.php on line 7053
PHP Deprecated: str_replace(): /wp-includes/functions.php on line 2165
-------------------------+-----------------------------------------------
 Reporter:  collieit     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  6.2.2
 Severity:  normal       |  Resolution:
 Keywords:  php81 close  |     Focuses:  administration, coding-standards
-------------------------+-----------------------------------------------
Changes (by jrf):

 * keywords:   => php81 close
 * focuses:  administration, sustainability, coding-standards =>
     administration, coding-standards


Comment:

 @collieit Thank you for reporting this. I presume you are talking about
 "passing null to non-nullable" notices ?

 While I appreciate your suggestion for adding more defensive coding, these
 issues should really be fixed in the plugins making the incorrect function
 call, which passes the `null`, while the WP functions, as documented,
 expect a non-`null` value.

 If more defensive coding would be added in the WP Core functions, it
 should be accompanied by a `_doing_it_wrong()`, which means we'd be
 effectively replacing an informative deprecation notice, with another
 notice, where the second notice has a higher error level.

 Please make sure you are using the latest versions of the involved plugins
 and if the notices are still there, please report them to the plugin
 authors.

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


More information about the wp-trac mailing list