Alternatively ensure the site is isolated before running. If an incorrect PHP version is used, composer install will fail with an error instead of installing.