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/plugin.php

    r53264 r53426  
    11511151                _x( '<strong>Error:</strong> Current versions of WordPress (%1$s) and PHP (%2$s) do not meet minimum requirements for %3$s. The plugin requires WordPress %4$s and PHP %5$s.', 'plugin' ),
    11521152                get_bloginfo( 'version' ),
    1153                 phpversion(),
     1153                PHP_VERSION,
    11541154                $plugin_headers['Name'],
    11551155                $requirements['requires'],
     
    11631163                /* translators: 1: Current PHP version, 2: Plugin name, 3: Required PHP version. */
    11641164                _x( '<strong>Error:</strong> Current PHP version (%1$s) does not meet minimum requirements for %2$s. The plugin requires PHP %3$s.', 'plugin' ),
    1165                 phpversion(),
     1165                PHP_VERSION,
    11661166                $plugin_headers['Name'],
    11671167                $requirements['requires_php']
Note: See TracChangeset for help on using the changeset viewer.