[php-src] master: Zend: remove zend_save_error_handling() (#23011)

Gina Peter Banyard via GitHub <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-08-04T21:01:46+01:00

Commit: https://github.com/php/php-src/commit/b7c967f67d055e473c0d7d89130721cc7069dfde
Raw diff: https://github.com/php/php-src/commit/b7c967f67d055e473c0d7d89130721cc7069dfde.diff

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

Changed paths:
  M  UPGRADING.INTERNALS
  M  Zend/zend.h
  M  Zend/zend_API.c


Diff:

diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 8a432cdeb5b5..4cded9eabfd3 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 0d5303192b57..a0f094324426 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 527f4e232538..de3570c5e848 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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.