Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,11 @@ 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) {
handler_fcc->function_handler = 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)) {
Expand Down
16 changes: 16 additions & 0 deletions ext/curl/tests/callable_nullable_option.phpt
Original file line number Diff line number Diff line change
@@ -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===