Opened 3 years ago
Closed 3 years ago
#58724 closed defect (bug) (duplicate)
Remove deprecated parameter test in convert_chars()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | performance | Cc: |
Description
Similar: #58723.
In convert_chars(), the last parameter is unused and is checked if it's not empty. If is is, only a deprecation warning is shown for a WordPress version of the distant past.
I suggest removing the parameter altogether.
If we _must_ keep the deprecation warning, at least use if ( $deprecated ) instead of if ( ! empty( $deprecated ) ) for the former is about 2.7x faster while achieving the same.
Here's the test proving ! empty() is slower than a plain boolean check: https://3v4l.org/YvKIn.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hello and thanks for the ticket!
I suspect there is a lot of other occurrences of this in Core, isn't it? In this case, maybe we can use #58723 as an umbrella ticket to address this general issue and send all the patches/PRs.