Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#65610 new enhancement

Replace the two uses of compact() in wpdb::determine_charset() with explicit array literals.

Reported by: arshidkv12 Owned by:
Priority: low Milestone: Awaiting Review
Component: General Version: 7.1
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Using explicit array literals:

  • Makes the returned array structure immediately visible.
  • Avoids the overhead of compact(), which performs variable lookup by name.
  • Improves readability and static analysis.
  • Aligns with modern PHP coding practices used elsewhere in WordPress core.

Change History (1)

This ticket was mentioned in ​PR #12479 on ​WordPress/wordpress-develop by ​@arshidkv12.


4 months ago
#1

Trac ticket: https://core.trac.wordpress.org/ticket/65610

## Use of AI Tools

None

Note: See TracTickets for help on using tickets.