#60073 closed defect (bug) (duplicate)
WordPress core function causing persistent deprecated warning when WP_DEBUG enabled
| Reported by: | earthman100 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Database | Version: | 6.4.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
3 years ago
- Description modified (diff)
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
Hi there, thanks for the ticket!
This was previously raised in #56836 and #54877:
- The
$database,$port, and$socketparameters ofmysqli_real_connect()should actually be nullable, as they arenullby 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This is on Pantheon hosting.