Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets the value of an environment variable
getenv(string $varnamebool $local_only false): string|false
        $g = ($color >> 8) & 255;

        
$b $color 255;



        if (
getenv('COLORTERM') !== 'truecolor') {

            return (string) 
$this->degradeHexColorToAnsi($r$g$b);

        }
    public function getWidth(): int

    
{

        
$width getenv('COLUMNS');

        if (
$width !== false) {

            return (int) 
trim($width);

        }
    public function getHeight(): int

    
{

        
$height getenv('LINES');

        if (
$height !== false) {

            return (int) 
trim($height);

        }
    private function initDimensions(): void

    
{

        if (
DIRECTORY_SEPARATOR === '\\') {

            if (
preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/'trim(getenv('ANSICON')), $matches)) {



                
self::$width  = (int) $matches[1];