diff --git a/src/lint/linter/ArcanistPhpLinter.php b/src/lint/linter/ArcanistPhpLinter.php --- a/src/lint/linter/ArcanistPhpLinter.php +++ b/src/lint/linter/ArcanistPhpLinter.php @@ -39,15 +39,12 @@ } public function getVersion() { - list($stdout) = execx('%C --version', $this->getExecutableCommand()); + list($stdout) = execx( + '%C --run %s', + $this->getExecutableCommand(), + 'echo phpversion();'); + return $stdout; - $matches = array(); - $regex = '/^PHP (?P<version>\d+\.\d+\.\d+)\b/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } } public function shouldExpectCommandErrors() {