[wp-trac] [WordPress Trac] #56935: Various deprecated warnings with WP 6.0.3 and PHP 8.1

WordPress Trac noreply at wordpress.org
Mon Oct 31 18:23:44 UTC 2022


#56935: Various deprecated warnings with WP 6.0.3 and PHP 8.1
-----------------------------+------------------------------
 Reporter:  applemango       |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  6.0.3
 Severity:  normal           |  Resolution:
 Keywords:  php81            |     Focuses:
-----------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => php81


Old description:

> I recently tried updating a WP 6.0.3 install to use PHP 8.1 but I
> immediately get various deprecated warnings from core code.
>
> For example here's a selection:
>
> Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of
> type array|string is deprecated in /home/applhpqm/public_html/wp-
> includes/formatting.php on line 5385
>
> Deprecated: trim(): Passing null to parameter #1 ($string) of type string
> is deprecated in /home/applhpqm/public_html/wp-includes/pluggable.php on
> line 599
>
> Deprecated: rtrim(): Passing null to parameter #1 ($string) of type
> string is deprecated in /home/applhpqm/public_html/wp-
> includes/formatting.php on line 2772
>
> 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 /home/applhpqm/public_html/wp-
> includes/Requests/Cookie/Jar.php on line 63
>
> 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 /home/applhpqm/public_html/wp-
> includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40
>
> 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 /home/applhpqm/public_html/wp-
> includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68
>
> Deprecated: http_build_query(): Passing null to parameter #2
> ($numeric_prefix) of type string is deprecated in
> /home/applhpqm/public_html/wp-includes/Requests/Transport/cURL.php on
> line 345
>
> Downgrading to 8.0 suppresses the errors.

New description:

 I recently tried updating a WP 6.0.3 install to use PHP 8.1 but I
 immediately get various deprecated warnings from core code.

 For example here's a selection:
 {{{
 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of
 type array|string is deprecated in /home/applhpqm/public_html/wp-
 includes/formatting.php on line 5385

 Deprecated: trim(): Passing null to parameter #1 ($string) of type string
 is deprecated in /home/applhpqm/public_html/wp-includes/pluggable.php on
 line 599

 Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string
 is deprecated in /home/applhpqm/public_html/wp-includes/formatting.php on
 line 2772

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

 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 /home/applhpqm/public_html/wp-
 includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

 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 /home/applhpqm/public_html/wp-
 includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

 Deprecated: http_build_query(): Passing null to parameter #2
 ($numeric_prefix) of type string is deprecated in
 /home/applhpqm/public_html/wp-includes/Requests/Transport/cURL.php on line
 345
 }}}
 Downgrading to 8.0 suppresses the errors.

--

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


More information about the wp-trac mailing list