is_php_version_compatible( string $required ): bool

In this article

Checks compatibility with the current PHP version.

Parameters

$requiredstringrequired
Minimum required PHP version.

Return

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

Source

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

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.