Make WordPress Core


Ignore:
Timestamp:
05/20/2022 05:36:23 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Replace phpversion() function calls with PHP_VERSION constant.

phpversion() return value and PHP_VERSION constant value are identical, but the latter is several times faster because it is a direct constant value lookup compared to a function call.

Props ayeshrajans, jrf, mukesh27, costdev, hellofromTonya, SergeyBiryukov.
Fixes #55680.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-cron.php

    r53300 r53426  
    2020
    2121/* Don't make the request block till we finish, if possible. */
    22 if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {
     22if ( PHP_VERSION_ID >= 70016 && function_exists( 'fastcgi_finish_request' ) ) {
    2323    if ( ! headers_sent() ) {
    2424        header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
Note: See TracChangeset for help on using the changeset viewer.