Commit 7e0b2e044ca for php

commit 7e0b2e044ca202174a58b95900fd7e5d51dba631
Merge: 931d8ea4e19 b0ea8b25375
Author: David Carlier <devnexen@gmail.com>
Date:   Thu Sep 24 11:02:56 2026 +0100

    Merge branch 'PHP-8.5' into PHP-8.6

    * PHP-8.5:
      sapi/cli: Fix crash in the CLI server when a client is reset before being accepted
      ext/curl: Preserve callback lifetime without rejecting callback changes (#23863)

    # Conflicts:
    #       ext/curl/interface.c

diff --cc ext/curl/interface.c
index 73088b0c7c9,bcfd44014b6..d1f0cee3d67
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@@ -838,11 -826,9 +854,9 @@@ static size_t curl_read(char *data, siz
  			} else {
  				ZVAL_NULL(&argv[1]);
  			}
 -			ZVAL_LONG(&argv[2], (int)size * nmemb);
 +			ZVAL_LONG(&argv[2], (zend_long) nmemb);

- 			ch->in_callback = true;
- 			zend_call_known_fcc(&read_handler->fcc, &retval, /* param_count */ 3, argv, /* named_params */ NULL);
- 			ch->in_callback = false;
+ 			php_curl_call_callback(ch, &read_handler->fcc, &retval, /* argc */ 3, argv);
  			if (!Z_ISUNDEF(retval)) {
  				_php_curl_verify_handlers(ch, /* reporterror */ true);
  				if (Z_TYPE(retval) == IS_STRING) {
@@@ -988,32 -914,30 +1000,30 @@@ static int curl_debug(CURL *handle, cur
  	// as the CURLOPT_DEBUGFUNCTION and stored the debug data when type is set to
  	// CURLINFO_HEADER_OUT. For backward compatibility, we now store the headers
  	// but also call the user-callback function if available.
 -    if (type == CURLINFO_HEADER_OUT) {
 -    	if (ch->header.str) {
 -    		zend_string_release_ex(ch->header.str, 0);
 -    	}
 -    	ch->header.str = zend_string_init(data, size, 0);
 -    }
 +	if (type == CURLINFO_HEADER_OUT) {
 +		if (ch->header.str) {
 +			zend_string_release_ex(ch->header.str, 0);
 +		}
 +		ch->header.str = zend_string_init(data, size, 0);
 +	}

 -    if (!ZEND_FCC_INITIALIZED(ch->handlers.debug)) {
 -       	return 0;
 -    }
 +	if (!ZEND_FCC_INITIALIZED(ch->handlers.debug)) {
 +		return 0;
 +	}

 -    zval args[3];
 +	zval args[3];

 -    GC_ADDREF(&ch->std);
 -    ZVAL_OBJ(&args[0], &ch->std);
 -    ZVAL_LONG(&args[1], type);
 -    ZVAL_STRINGL(&args[2], data, size);
 +	GC_ADDREF(&ch->std);
 +	ZVAL_OBJ(&args[0], &ch->std);
 +	ZVAL_LONG(&args[1], type);
 +	ZVAL_STRINGL(&args[2], data, size);

- 	ch->in_callback = true;
- 	zend_call_known_fcc(&ch->handlers.debug, NULL, /* param_count */ 3, args, /* named_params */ NULL);
- 	ch->in_callback = false;
 -    php_curl_call_callback(ch, &ch->handlers.debug, NULL, /* argc */ 3, args);
++	php_curl_call_callback(ch, &ch->handlers.debug, NULL, /* argc */ 3, args);

 -    zval_ptr_dtor(&args[0]);
 -    zval_ptr_dtor(&args[2]);
 +	zval_ptr_dtor(&args[0]);
 +	zval_ptr_dtor(&args[2]);

 -    return 0;
 +	return 0;
  }
  /* }}} */