diff --git a/src/services/phar/CompatibilityService.php b/src/services/phar/CompatibilityService.php index c5e20da3..93d51cde 100644 --- a/src/services/phar/CompatibilityService.php +++ b/src/services/phar/CompatibilityService.php @@ -49,7 +49,12 @@ public function canRun(Phar $phar) { case $requirement instanceof PhpVersionRequirement: { $php = $requirement->getVersionConstraint(); - if (!$php->complies(new Version(PHP_VERSION))) { + try { + $phpversion = new Version(PHP_VERSION); + } catch (InvalidVersionException $ex) { + $phpversion = new Version(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION); + } + if (!$php->complies($phpversion)) { $issues[] = sprintf( 'PHP Version %s required, but %s in use', $php,