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-admin/includes/file.php

    r53060 r53426  
    13861386            ),
    13871387            array(
    1388                 'php'    => phpversion(),
     1388                'php'    => PHP_VERSION,
    13891389                'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    13901390            )
     
    14211421                ),
    14221422                array(
    1423                     'php'                => phpversion(),
     1423                    'php'                => PHP_VERSION,
    14241424                    'sodium'             => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    14251425                    'polyfill_is_fast'   => false,
     
    14941494            'skipped_key' => $skipped_key,
    14951495            'skipped_sig' => $skipped_signature,
    1496             'php'         => phpversion(),
     1496            'php'         => PHP_VERSION,
    14971497            'sodium'      => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    14981498        )
Note: See TracChangeset for help on using the changeset viewer.