Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#58942 closed enhancement (fixed)

Replace `php_sapi_name` function with `PHP_SAPI` constant

Reported by: ayeshrajans's profile ayeshrajans Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.4 Priority: normal
Severity: trivial Version:
Component: General Keywords: has-patch commit
Focuses: performance, coding-standards Cc:

Description

Super-micro optimization that replaces php_sapi_name function call with PHP_SAPI constant. One fewer function call, although it would take millions of calls to have a meaningful difference.

Attachments (1)

Screenshot 2023-08-01 at 6.04.22 PM.png (34.0 KB) - added by mukesh27 12 months ago.

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in PR #4934 on WordPress/wordpress-develop by @ayeshrajans.


12 months ago
#1

Super-micro optimization that replaces php_sapi_name function call with PHP_SAPI constant. One fewer function call, although it would take millions of calls to have a meaningful difference.

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

#2 @ayeshrajans
12 months ago

  • Summary changed from Repalce `php_sapi_name` function with `PHP_SAPI` constant to Replace `php_sapi_name` function with `PHP_SAPI` constant

#3 @SergeyBiryukov
12 months ago

  • Milestone changed from Awaiting Review to 6.4

#4 @SergeyBiryukov
12 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#5 @mukesh27
12 months ago

  • Keywords commit added
  • Version trunk deleted

Thanks @ayeshrajans for ticket and PR.

The PR 4934 got enough approval.

@SergeyBiryukov could you please take final review.

#6 @SergeyBiryukov
12 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 56346:

Site Health: Use PHP_SAPI constant instead of the php_sapi_name() function.

This is a micro-optimization that removes an unnecessary function call.

Follow-up to [44986], [45156].

Props ayeshrajans, jrf, mukesh27, rmccue.
Fixes #58942.

@SergeyBiryukov commented on PR #4934:


12 months ago
#7

Thanks for the PR! Merged in r56346.

Note: See TracTickets for help on using tickets.