WordPress at Your Fingertips

is_php_version_compatible() WP 1.0

Checks compatibility with the current PHP version.

1 time — 0.000001 sec (speed of light) | 50000 times — 0.02 sec (speed of light) | PHP 7.2.16, WP 5.2

No Hooks.

Return

true|false. True if required version is compatible or empty, false if not.

Usage

is_php_version_compatible( $required );
$required(string) (required)
Minimum required PHP version.

Changelog

Since 5.2.0 Introduced.

Code of is_php_version_compatible() WP 5.8.1

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