Note that as of PHP 8.1, you will get deprecated errors if the arguments are floating point. You will save yourself a lot of angst if you cast the arguments:
<?php
imagecopyresampled(
$dst_image, $src_image,
(int) $dst_x, (int) $dst_y,
(int) $src_x, (int) $src_y,
(int) $dst_width, (int) $dst_height,
(int) $src_width, (int) $src_height
);
?>
You could also have rounded them off, but I think casting them is truer to the original behaviour.