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.
Built from https://develop.svn.wordpress.org/trunk@53426


git-svn-id: http://core.svn.wordpress.org/trunk@53015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2022-05-20 17:38:14 +00:00
parent 59c970101f
commit 40fc19024f
18 changed files with 31 additions and 36 deletions

View File

@@ -228,7 +228,7 @@ if ( is_blog_installed() ) {
*/
global $wp_version, $required_php_version, $required_mysql_version;
$php_version = phpversion();
$php_version = PHP_VERSION;
$mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );