From a8bf91b5bec94e0aa4dd4f4eb691f68409fada94 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 4 Aug 2026 00:57:01 +0100 Subject: [PATCH] Zend: remove zend_save_error_handling() 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 --- UPGRADING.INTERNALS | 1 + Zend/zend.h | 1 - Zend/zend_API.c | 10 ++-------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 8b4b5912317a..5b64248f543b 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -120,6 +120,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 71754b9ab755..27285a031d7b 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -5193,17 +5193,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;