Skip to content

Commit bf64f58

Browse files
committed
Merge branch 'PHP-8.6'
* PHP-8.6: Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367) Fix the argument named by the imageaffine() element TypeError (#25369)
2 parents e0e2095 + 09e9e27 commit bf64f58

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎ext/curl/multi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ static bool _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue
487487
char *error_str = NULL;
488488
if (UNEXPECTED(!zend_is_callable(zvalue, &mh->handlers.server_push, &error_str))) {
489489
if (!EG(exception)) {
490-
zend_argument_type_error(2, "must be a valid callback for option CURLMOPT_PUSHFUNCTION, %s", error_str);
490+
zend_argument_type_error(3, "must be a valid callback for option CURLMOPT_PUSHFUNCTION, %s", error_str);
491491
}
492492
efree(error_str);
493493
return false;

‎ext/curl/tests/curl_multi_setopt_callables.phpt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414

1515
?>
1616
--EXPECT--
17-
TypeError: curl_multi_setopt(): Argument #2 ($option) must be a valid callback for option CURLMOPT_PUSHFUNCTION, function "undefined" not found or invalid function name
17+
TypeError: curl_multi_setopt(): Argument #3 ($value) must be a valid callback for option CURLMOPT_PUSHFUNCTION, function "undefined" not found or invalid function name

‎ext/gd/gd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4128,7 +4128,7 @@ PHP_FUNCTION(imageaffine)
41284128
}
41294129
break;
41304130
default:
4131-
zend_argument_type_error(3, "contains invalid type for element %i", i);
4131+
zend_argument_type_error(2, "contains invalid type for element %i", i);
41324132
RETURN_THROWS();
41334133
}
41344134
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
imageaffine(): the TypeError for an invalid element names the $affine argument
3+
--EXTENSIONS--
4+
gd
5+
--FILE--
6+
<?php
7+
$im = imagecreatetruecolor(20, 20);
8+
try {
9+
imageaffine($im, [1, 0, null, 1, 0, 0]);
10+
} catch (Throwable $e) {
11+
echo $e::class, ': ', $e->getMessage(), "\n";
12+
}
13+
?>
14+
--EXPECT--
15+
TypeError: imageaffine(): Argument #2 ($affine) contains invalid type for element 2

0 commit comments

Comments
 (0)