<?php
declare(strict_types=1);

$info = gd_info();
$formats = [];
foreach (["PNG Support" => "png", "JPEG Support" => "jpg"] as $key => $extension) {
    if ($info[$key] ?? false) { $formats[] = $extension; }
}
echo implode(",", $formats), "\n";
