Commit 3ed338c46b4 for php.net

commit 3ed338c46b4e615d57af2ea005337e2f74901a5a
Merge: 951680712b4 b8ff8d64ac5
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date:   Sun Jun 14 11:00:05 2026 -0400

    Merge branch 'PHP-8.5'

    * PHP-8.5:
      Fix GH-22112: assertion when error handler throws during NaN coercion

diff --cc Zend/zend_API.c
index 46b62dcc7c4,e874c4a5bbd..e334b18fe1a
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@@ -513,11 -534,16 +513,15 @@@ ZEND_API zpp_parse_bool_status ZEND_FAS
  {
  	if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
  		if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) {
 -			return 0;
 +			return ZPP_PARSE_BOOL_STATUS_ERROR;
  		}
- 		return zend_is_true(arg);
 -		*dest = zend_is_true(arg);
++		bool result = zend_is_true(arg);
+ 		if (UNEXPECTED(EG(exception))) {
 -			return 0;
++			return ZPP_PARSE_BOOL_STATUS_ERROR;
+ 		}
 -	} else {
 -		return 0;
++		return result;
  	}
 -	return 1;
 +	return ZPP_PARSE_BOOL_STATUS_ERROR;
  }
  /* }}} */

@@@ -732,10 -762,13 +736,13 @@@ ZEND_API zend_string* ZEND_FASTCALL zen
  {
  	if (EXPECTED(Z_TYPE_P(arg) < IS_STRING)) {
  		if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("string", arg_num)) {
 -			return 0;
 +			return NULL;
  		}
  		convert_to_string(arg);
+ 		if (UNEXPECTED(EG(exception))) {
 -			return 0;
++			return NULL;
+ 		}
 -		*dest = Z_STR_P(arg);
 +		return Z_STR_P(arg);
  	} else if (UNEXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
  		zend_object *zobj = Z_OBJ_P(arg);
  		zval obj;