#60073 closed defect (bug) (duplicate)
WordPress core function causing persistent deprecated warning when WP_DEBUG enabled
Reported by: | earthman100 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.4.2 |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Upgrading to PHP 8.1 surfaces this
Deprecated: mysqli_real_connect(): Passing null to parameter #5 ($database) of type ?string is deprecated in /code/wp-includes/class-wpdb.php on line 1987 Deprecated: mysqli_real_connect(): Passing null to parameter #7 ($socket) of type ?string is deprecated in /code/wp-includes/class-wpdb.php on line 1987
From what I can see, Parameter # 5 and # 7 are both explicitly set as null directly in the core file - see attached:
Change History (3)
#2
in reply to:
↑ description
@
12 months ago
- Description modified (diff)
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Hi there, thanks for the ticket!
This was previously raised in #56836 and #54877:
- The
$database
,$port
, and$socket
parameters ofmysqli_real_connect()
should actually be nullable, as they arenull
by default in PHP source, per comment:15:ticket:54877. According to the PHP manual, these parameters can all acceptnull
. - The issue is caused by LiteSpeed PHP, per comment:3:ticket:56836.
Note: See
TracTickets for help on using
tickets.
This is on Pantheon hosting.