W3cubDocs

/WordPress

is_php_version_compatible( string $required )

Checks compatibility with the current PHP version.

Parameters

$required

(string) (Required) Minimum required PHP version.

Return

(bool) True if required version is compatible or empty, false if not.

Source

File: wp-includes/functions.php

function is_php_version_compatible( $required ) {
	return empty( $required ) || version_compare( phpversion(), $required, '>=' );
}

Changelog

Version Description
5.2.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_php_version_compatible