Commit d03d69a88a3 for php.net

commit d03d69a88a3f8dd4772833fc81b293750eb7b482
Author: Khaled Alam <khaledalam.net@gmail.com>
Date:   Fri Jan 30 19:37:13 2026 +0400

    Remove duplicate #include statements (#21085)

    * Remove duplicate #include statements across the codebase.

    * feat: Restore conditional/unconditional include pairs in lscriu.c

diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c
index 645edd2f999..884b481aceb 100644
--- a/Zend/Optimizer/zend_call_graph.c
+++ b/Zend/Optimizer/zend_call_graph.c
@@ -23,8 +23,6 @@
 #include "zend_inference.h"
 #include "zend_call_graph.h"
 #include "zend_func_info.h"
-#include "zend_inference.h"
-#include "zend_call_graph.h"

 static void zend_op_array_calc(zend_op_array *op_array, void *context)
 {
diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c
index f3b0d663dd6..cec52f7e986 100644
--- a/Zend/Optimizer/zend_func_info.c
+++ b/Zend/Optimizer/zend_func_info.c
@@ -24,7 +24,6 @@
 #include "zend_inference.h"
 #include "zend_call_graph.h"
 #include "zend_func_info.h"
-#include "zend_inference.h"
 #ifdef _WIN32
 #include "win32/ioutil.h"
 #endif
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 6075ae3d1e5..006a89597ae 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -1031,12 +1031,6 @@ void zend_assert_valid_class_name(const zend_string *const_name, const char *typ
 zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scope);
 ZEND_API zend_string *zend_type_to_string(zend_type type);

-/* BEGIN: OPCODES */
-
-#include "zend_vm_opcodes.h"
-
-/* END: OPCODES */
-
 /* class fetches */
 #define ZEND_FETCH_CLASS_DEFAULT	0
 #define ZEND_FETCH_CLASS_SELF		1
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 0105106d953..5a0e1f3c7a0 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -35,7 +35,6 @@
 #include <libxml/uri.h>
 #include <libxml/xmlerror.h>
 #include <libxml/xmlsave.h>
-#include <libxml/xmlerror.h>
 #include <libxml/entities.h>
 #ifdef LIBXML_SCHEMAS_ENABLED
 #include <libxml/relaxng.h>
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 26264aa2b17..b171986d29c 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -32,7 +32,6 @@
 #include "zend_exceptions.h"
 #include "ext/spl/spl_exceptions.h"
 #include "zend_interfaces.h"
-#include "zend_attributes.h"
 #include "mysqli_arginfo.h"

 ZEND_DECLARE_MODULE_GLOBALS(mysqli)
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 5dd1dc4090c..2d8ee9c435e 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -27,7 +27,6 @@
 #include "main/SAPI.h"
 #include "zend_exceptions.h"
 #include "zend_interfaces.h"
-#include "zend_exceptions.h"

 static zend_class_entry *phar_ce_archive;
 static zend_class_entry *phar_ce_data;
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1d7f2c1a9b5..d96de3947d5 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -102,7 +102,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif

 #include "zend_globals.h"
-#include "php_globals.h"
 #include "SAPI.h"
 #include "php_ticks.h"

diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index d1bb3aeeccd..92200e64f23 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -41,7 +41,6 @@
 #include "php_standard.h"
 #include "ext/uri/php_uri.h"

-#include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index da150381f43..b5c06b84a6a 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -44,7 +44,6 @@

 #include "php_standard.h"

-#include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 63564cc73bd..f1ab7312c46 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -44,7 +44,6 @@
 #include <pwd.h>
 #endif

-#include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
diff --git a/main/main.c b/main/main.c
index 446ac0fcb79..afb9291586d 100644
--- a/main/main.c
+++ b/main/main.c
@@ -64,7 +64,6 @@
 #include "win32/php_registry.h"
 #include "ext/standard/flock_compat.h"
 #endif
-#include "php_syslog.h"
 #include "Zend/zend_exceptions.h"

 #if PHP_SIGCHILD
@@ -75,7 +74,6 @@
 #include "zend_compile.h"
 #include "zend_execute.h"
 #include "zend_highlight.h"
-#include "zend_extensions.h"
 #include "zend_ini.h"
 #include "zend_dtrace.h"
 #include "zend_observer.h"
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index e051964a815..a31ba68f928 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -37,7 +37,6 @@
 #include "http_log.h"
 #include "http_main.h"
 #include "util_script.h"
-#include "http_core.h"

 #ifdef PHP_AP_DEBUG
 #define phpapdebug(a) fprintf a
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 84437f12ebe..9b073207c81 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -41,7 +41,6 @@
 #include "http_log.h"
 #include "http_main.h"
 #include "util_script.h"
-#include "http_core.h"
 #include "ap_mpm.h"
 #ifndef PHP_WIN32
 #include "unixd.h"
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 88fc584a8bc..2387d24741a 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -46,7 +46,6 @@
 #include "http_log.h"
 #include "http_main.h"
 #include "util_script.h"
-#include "http_core.h"
 #include "ap_mpm.h"

 #include "php_apache.h"
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 6db96a43ac9..3decc673389 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -59,7 +59,6 @@
 #include "zend.h"
 #include "zend_extensions.h"
 #include "php_ini.h"
-#include "php_globals.h"
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "http_status_codes.h"
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 460acb62664..d1781eab671 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -31,7 +31,6 @@
 #include "SAPI.h"

 #include <stdio.h>
-#include "php.h"
 #ifdef PHP_WIN32
 #include "win32/time.h"
 #include "win32/signal.h"
@@ -51,7 +50,6 @@
 #include "zend.h"
 #include "zend_extensions.h"
 #include "php_ini.h"
-#include "php_globals.h"
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "ext/standard/php_standard.h"
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 046e2174dc1..bab7ad011e0 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -44,7 +44,6 @@
 #include <unistd.h>
 #endif

-#include <signal.h>
 #include <locale.h>

 #ifdef HAVE_DLFCN_H
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 63f911af490..3979d875a18 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -8,7 +8,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stddef.h>
-#include <string.h>
 #include <inttypes.h>

 #include <stdio.h>
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index cc89b8c07c1..f1f7de70b27 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -24,7 +24,6 @@
 #include "php_variables.h"
 #include "php_ini_builder.h"
 #include "zend_modules.h"
-#include "php.h"
 #include "zend_ini_scanner.h"
 #include "zend_globals.h"
 #include "zend_stream.h"
@@ -32,7 +31,6 @@
 #include "SAPI.h"

 #include <stdio.h>
-#include "php.h"

 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
@@ -61,7 +59,6 @@
 #include "zend.h"
 #include "zend_extensions.h"
 #include "php_ini.h"
-#include "php_globals.h"
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "ext/standard/php_standard.h"
diff --git a/sapi/litespeed/lscriu.c b/sapi/litespeed/lscriu.c
index 042f5fb7a2b..9d4096ec1c3 100644
--- a/sapi/litespeed/lscriu.c
+++ b/sapi/litespeed/lscriu.c
@@ -73,7 +73,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <sys/mman.h>
 #include <fcntl.h>
 #include <dlfcn.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <string.h>
 #include <stdarg.h>
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index 50cb93f05f6..eb711632eb5 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -16,7 +16,6 @@ typedef void* yyscan_t;

 #include "phpdbg_cmd.h"
 #include "phpdbg_utils.h"
-#include "phpdbg_cmd.h"
 #include "phpdbg_prompt.h"

 #include "phpdbg_parser.h"