The php Function gd_info() Returns a List of GD Features
When you want to manipulate an image in your web application, you use a library such as GD or ImageMagick. These libraries are usually available in most server environments, but you may need to install them manually in certain situations.
The php function gd_info() returns a list of GD features, including whether or not AVIF support is enabled. This feature was added in the GD extension as of PHP 8.1 and depends on the libavif package, which may not be available on older systems. The GD extension has also been updated to include two new functions for working with AVIF images: imagecreatefromavif and imageavif.
GD is an extensible graphic library that supports many image formats such as PNG, JPEG, GIF, BMP and TIFF. It also provides support for various drawing and transformation functions. You can find a complete list of supported formats and functions on the official GD documentation page.
For compatibility reasons, GD includes a number of functions that are not compatible with PHP4 and earlier. For example, the function gd_info() will return an error if it is called with a parameter that is not a valid HTML entity such as
Another option is to use the kind declarations introduced in PHP 7, which specify the intended data type for a method. This will ensure that if the data types don’t match, a PHP Fatal Error is thrown.