function linkedPhp()
    {
        $matches = $this->getParsedLinkedPhp();
        $resolvedPhpVersion = $matches[3] ?: $matches[2];

        return $this->supportedPhpVersions()->first(   
            function ($version) use ($resolvedPhpVersion) {
                $resolvedVersionNormalized = preg_replace('/[^\d]/', '', $resolvedPhpVersion);
                $versionNormalized = preg_replace('/[^\d]/', '', $version);
                return $resolvedVersionNormalized === $versionNormalized;
        }, function () use ($resolvedPhpVersion) {
            throw new DomainException("Unable to determine linked PHP when parsing '$resolvedPhpVersion'");
        });
    }
function linkedPhp()
    {
        $matches = $this->getParsedLinkedPhp();
        $resolvedPhpVersion = $matches[3] ?: $matches[2];

        return $this->supportedPhpVersions()->first(   
            function ($version) use ($resolvedPhpVersion) {
                $resolvedVersionNormalized = preg_replace('/[^\d]/', '', $resolvedPhpVersion);
                $versionNormalized = preg_replace('/[^\d]/', '', $version);
                return $resolvedVersionNormalized === $versionNormalized;
        }, function () use ($resolvedPhpVersion) {
            throw new DomainException("Unable to determine linked PHP when parsing '$resolvedPhpVersion'");
        });
    }
function linkedPhp ( ) { $ matches = $ this -> getParsedLinkedPhp ( ) ; $ resolvedPhpVersion = $ matches [ 3 ] ? : $ matches [ 2 ] ; return $ this -> supportedPhpVersions ( ) -> first ( function ( $ version ) use ( $ resolvedPhpVersion ) { $ resolvedVersionNormalized = preg_replace ( '/[^\d]/' , '' , $ resolvedPhpVersion ) ; $ versionNormalized = preg_replace ( '/[^\d]/' , '' , $ version ) ; return $ resolvedVersionNormalized === $ versionNormalized ; } , function ( ) use ( $ resolvedPhpVersion ) { throw new DomainException ( "Unable to determine linked PHP when parsing '$resolvedPhpVersion'" ) ; } ) ; }
Determine which version of PHP is linked in Homebrew.

@return string
Determine which version of PHP is linked in Homebrew .