Callable curl options should be nullable

symfony/http-client/Response/CurlResponse.php depends on this behavior.

Closes GH-14165
This commit is contained in:
Ilija Tovilo 2024-05-07 13:43:57 +02:00
parent 90c5b2a43b
commit d2a9edfee6
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
2 changed files with 20 additions and 0 deletions

View File

@ -1520,6 +1520,10 @@ static bool php_curl_set_callable_handler(zend_fcall_info_cache *const handler_f
zend_fcc_dtor(handler_fcc);
}
if (Z_TYPE_P(callable) == IS_NULL) {
return true;
}
char *error = NULL;
if (UNEXPECTED(!zend_is_callable_ex(callable, /* object */ NULL, /* check_flags */ 0, /* callable_name */ NULL, handler_fcc, /* error */ &error))) {
if (!EG(exception)) {

View File

@ -0,0 +1,16 @@
--TEST--
Callable options are nullable
--EXTENSIONS--
curl
--FILE--
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_PROGRESSFUNCTION => null,
]);
?>
===DONE===
--EXPECT--
===DONE===