Skip to content

Fix the argument named by the imageaffine() element TypeError - #25369

Merged
TimWolla merged 1 commit into
php:PHP-8.4from
lacatoire:fix/imageaffine-element-type-error-argument-8.4
Nov 10, 2026
Merged

TimWolla merged 1 commit into
php:PHP-8.4from
lacatoire:fix/imageaffine-element-type-error-argument-8.4

Conversation

@lacatoire

Copy link
Copy Markdown
Member

imageaffine() names the wrong argument when an element of $affine has an unsupported type: the error blames $clip, but the matrix is the $affine argument.

To reproduce

<?php
try {
    imageaffine(imagecreatetruecolor(20, 20), [1, 0, null, 1, 0, 0]);
} catch (Throwable $e) {
    echo $e::class, ': ', $e->getMessage(), "\n";
}

Before (8.4.26 and 8.5.12):

TypeError: imageaffine(): Argument #3 ($clip) contains invalid type for element 2

After:

TypeError: imageaffine(): Argument #2 ($affine) contains invalid type for element 2

@TimWolla
TimWolla merged commit b6df294 into php:PHP-8.4 Nov 10, 2026
18 checks passed
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.4:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.5:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.6:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants