[php-src] PR #25372: Fix the argument blamed by the imagepolygon() too few points error
| From: | lacatoire | Date: | Tue, 10 Nov 2026 16:00:47 +0000 |
| Subject: | [php-src] PR #25372: Fix the argument blamed by the imagepolygon() too few points error | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40514@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25372
Author: lacatoire
In the three-argument form,
imagepolygon(), imageopenpolygon() and
imagefilledpolygon() derive the point count from $points, but the
"too few points" error blamed argument 3, which is the colour there. It now blames
$points in that form, and argument 3 is kept for the deprecated
$num_points form.
### To reproduce
```php
<?php
imageopenpolygon(imagecreatetruecolor(20, 20), [1, 1, 2, 2], 0xffffff);
```
Before: ValueError: imageopenpolygon(): Argument #3 ($num_points_or_color) must be greater
than or equal to 3
After: ValueError: imageopenpolygon(): Argument #2 ($points) must have at least 3
points