- imagefilledpolygon($image, $points, 4, $color);
- return imagepolygon($image, $points, 4, $color);
+ if (PHP_MAJOR_VERSION >= 8) { // num_points is deprecated
+ imagefilledpolygon($image, $points, $color);
+ return imagepolygon($image, $points, $color);
+ }
+ else {
+ imagefilledpolygon($image, $points, 4, $color);
+ return imagepolygon($image, $points, 4, $color);
+ }