Namespace PHPStan\Php

Classes
PhpVersion

Represents a specific PHP version for version-dependent analysis behavior. The version is stored as PHP_VERSION_ID format (e.g. 80100 for PHP 8.1.0). Extension developers can access it by injecting PhpVersion via constructor injection.

PhpVersions

Range-aware PHP version check that handles version uncertainty. Unlike PhpVersion (which represents a single known version), PhpVersions wraps a Type representing the possible PHP versions. When the exact version is known, queries return Yes/No. When a range of versions is possible, queries return Maybe. This is the return type of Scope::getPhpVersion().