<?php
declare(strict_types=1);

$label = "SKU42";
$width = strlen($label) * imagefontwidth(3) + 8;
$height = imagefontheight(3) + 8;
$image = imagecreatetruecolor($width, $height);
$ink = imagecolorallocate($image, 255, 255, 255);
imagestring($image, 3, 4, 4, $label, $ink);
echo imagesx($image) > 8 && imagesy($image) > 8 ? "text and padding fit\n" : "too small\n";
