Commit b7c967f67d0 for php.net

commit b7c967f67d055e473c0d7d89130721cc7069dfde
Author: Gina Peter Banyard <girgias@php.net>
Date:   Tue Aug 4 21:01:46 2026 +0100

    Zend: remove zend_save_error_handling() (#23011)

    This function is only used once internally, and no usage is reported from a SourceGraph search. [1]

    [1] https://sourcegraph.com/search?q=context:global+-f:zend_API.c+-f:zend.h+zend_save_error_handling&patternType=keyword&sm=0

diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 8a432cdeb5b..4cded9eabfd 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -133,6 +133,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES
     flags parameter was never used.
   . The PHP stream function _php_stream_flush() was removed,
     instead the PHP macro php_stream_flush() is now a proper function.
+  . The zend_save_error_handling() function was removed.

 - Changed:
   . Internal functions that return by reference are now expected to
diff --git a/Zend/zend.h b/Zend/zend.h
index 0d5303192b5..a0f09432442 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -446,7 +446,6 @@ typedef struct {
 } zend_error_handling;

 BEGIN_EXTERN_C()
-ZEND_API void zend_save_error_handling(zend_error_handling *current);
 ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current);
 ZEND_API void zend_restore_error_handling(const zend_error_handling *saved);
 ZEND_API void zend_begin_record_errors(void);
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 527f4e23253..de3570c5e84 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -5196,17 +5196,11 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *na
 }
 /* }}} */

-ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */
-{
-	current->handling = EG(error_handling);
-	current->exception = EG(exception_class);
-}
-/* }}} */
-
 ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current) /* {{{ */
 {
 	if (current) {
-		zend_save_error_handling(current);
+		current->handling = EG(error_handling);
+		current->exception = EG(exception_class);
 	}
 	ZEND_ASSERT(error_handling == EH_THROW || exception_class == NULL);
 	EG(error_handling) = error_handling;