public static function getVar(string $name, $default = null)
    {
        if (array_key_exists($name, $_ENV)) {
            return $_ENV[$name];
        } elseif (array_key_exists($name, $_SERVER)) {
            return $_SERVER[$name];
        } else {
            $value = getenv($name);

            if ($value === false) {
                return $default;
            }

            return $value;
        }
    }
public static function getVar(string $name, $default = null)
    {
        if (array_key_exists($name, $_ENV)) {
            return $_ENV[$name];
        } elseif (array_key_exists($name, $_SERVER)) {
            return $_SERVER[$name];
        } else {
            $value = getenv($name);

            if ($value === false) {
                return $default;
            }

            return $value;
        }
    }
public static function getVar ( string $ name , $ default = null ) { if ( array_key_exists ( $ name , $ _ENV ) ) { return $ _ENV [ $ name ] ; } elseif ( array_key_exists ( $ name , $ _SERVER ) ) { return $ _SERVER [ $ name ] ; } else { $ value = getenv ( $ name ) ; if ( $ value === false ) { return $ default ; } return $ value ; } }
Gets the value of an environment variable

@param string $name The name of the environment variable to get
@param mixed $default The default value if none existed
@return string|null The value of the environment value if one was set, otherwise null
Gets the value of an environment variable