[php-src] PR #17094: Simplify parsing of affine matrix arguments
| From: | cmb69 | Date: | Mon, 09 Dec 2024 13:25:51 +0000 |
| Subject: | [php-src] PR #17094: Simplify parsing of affine matrix arguments | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29952@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17094
Author: cmb69
This code repetition is prone to errors and makes the code harder to read than necessary. We
simplify at the cost of making parsing of ints slightly less performant (what should not really
matter in practice).
---
So far this is fully backwards compatible. However, given that the
$clip argument of
imageaffine() uses zend_get_long() without further type checks, we could
use zend_get_double() for the matrix arguments also without further type checks. Or
perhaps being more strict. As is, the documentation (which is highly incomplete for now) would need
to go to great lengths to explain which types are supported for the array elements and how they are
handled.