Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get the integer value of a variable
intval(mixed $valueint $base 10): int
            $result[3] = 1;

        } elseif (
preg_match($rgbPattern$value$matches)) {

            
$result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = 1;
        } elseif (preg_match($rgbPattern$value$matches)) {

            
$result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = 1;

        } elseif (
preg_match($rgbaPattern$value$matches)) {
            $result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = 1;

        } elseif (
preg_match($rgbaPattern$value$matches)) {

            
$result = [];
            $result[3] = 1;

        } elseif (
preg_match($rgbaPattern$value$matches)) {

            
$result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = ($matches[4] >= && $matches[4] <= 1) ? $matches[4] : 0;
        } elseif (preg_match($rgbaPattern$value$matches)) {

            
$result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = ($matches[4] >= && $matches[4] <= 1) ? $matches[4] : 0;

        } else {
            $result = [];

            
$result[0] = ($matches[1] >= && $matches[1] <= 255) ? intval($matches[1]) : 0;

            
$result[1] = ($matches[2] >= && $matches[2] <= 255) ? intval($matches[2]) : 0;

            
$result[2] = ($matches[3] >= && $matches[3] <= 255) ? intval($matches[3]) : 0;

            
$result[3] = ($matches[4] >= && $matches[4] <= 1) ? $matches[4] : 0;

        } else {

            throw new 
NotReadableException(
            );

        }



        
$this->quality intval($quality);



        return 
$this;

    }
    public function border($width$color null)

    {

        
$this->border_width is_numeric($width) ? intval($width) : 0;

        
$this->border_color is_null($color) ? '#000000' $color;

    }
    private function isDigit($value)

    {

        return 
is_numeric($value) ? intval($value) == $value false;

    }

}
    public function __construct($size null)

    {

        
$this->size is_numeric($size) ? intval($size) : self::DEFAULT_SIZE;

    }
    public function initFromRgb($r$g$b)

    {

        
$this->intval($r);

        
$this->intval($g);

        
$this->intval($b);

        
$this->0;
    public function initFromRgb($r$g$b)

    {

        
$this->intval($r);

        
$this->intval($g);

        
$this->intval($b);

        
$this->0;

    }
    {

        
$this->intval($r);

        
$this->intval($g);

        
$this->intval($b);

        
$this->0;

    }
    public function initFromRgba($r$g$b$a 1)

    {

        
$this->intval($r);

        
$this->intval($g);

        
$this->intval($b);

        
$this->$this->alpha2gd($a);
    public function initFromRgba($r$g$b$a 1)

    {

        
$this->intval($r);

        
$this->intval($g);

        
$this->intval($b);

        
$this->$this->alpha2gd($a);

    }