Commit 3afe4e3edea for php.net

commit 3afe4e3edeaee2d5c7cf7552e783ab9b3f41f75e
Author: Weilin Du <weilindu@php.net>
Date:   Sat Jul 4 19:52:47 2026 +0800

    Remove various useless `#include` (#22581)

    This removes leftover win32/param.h / <sys/param.h> includes from files that
    do not use any of the macros provided by those headers (MAXPATHLEN,
    MAXHOSTNAMELEN, howmany, roundup).

    It also removes local Windows O_RDONLY -> _O_RDONLY aliases from files where
    O_RDONLY is not used.

diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c
index 779b41fcad3..c3c08327fbe 100644
--- a/ext/ffi/ffi.c
+++ b/ext/ffi/ffi.c
@@ -34,11 +34,9 @@

 #ifdef HAVE_LIBDL
 #ifdef PHP_WIN32
-#include "win32/param.h"
 #include "win32/winutil.h"
 #define GET_DL_ERROR()  php_win_err()
 #else
-#include <sys/param.h>
 #define GET_DL_ERROR()  DL_ERROR()
 #endif
 #endif
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 457d1410aab..dfe905a8c22 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -30,10 +30,6 @@

 #ifdef PHP_WIN32
 #include <winsock2.h>
-#define O_RDONLY _O_RDONLY
-#include "win32/param.h"
-#else
-#include <sys/param.h>
 #endif

 #include "php_standard.h"
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 195394c7ed8..4b2aa7116a2 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -33,13 +33,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>

-#ifdef PHP_WIN32
-#define O_RDONLY _O_RDONLY
-#include "win32/param.h"
-#else
-#include <sys/param.h>
-#endif
-
 #include "php_standard.h"

 #ifdef HAVE_SYS_SOCKET_H
diff --git a/main/network.c b/main/network.c
index 84a755505b2..b4d3ded1519 100644
--- a/main/network.c
+++ b/main/network.c
@@ -24,10 +24,6 @@
 #ifdef PHP_WIN32
 # include <Ws2tcpip.h>
 # include "win32/winutil.h"
-# define O_RDONLY _O_RDONLY
-# include "win32/param.h"
-#else
-#include <sys/param.h>
 #endif

 #include <sys/types.h>
diff --git a/main/php_scandir.c b/main/php_scandir.c
index 848a0cf9616..c180272e5f4 100644
--- a/main/php_scandir.c
+++ b/main/php_scandir.c
@@ -27,7 +27,6 @@
 #ifndef HAVE_SCANDIR

 #ifdef PHP_WIN32
-#include "win32/param.h"
 #include "win32/readdir.h"
 #endif

diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 2da7e419300..d6249ae068d 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -48,11 +48,9 @@ extern int phpdbg_startup_run;

 #ifdef HAVE_LIBDL
 #ifdef PHP_WIN32
-#include "win32/param.h"
 #include "win32/winutil.h"
 #define GET_DL_ERROR()  php_win_err()
 #else
-#include <sys/param.h>
 #define GET_DL_ERROR()  DL_ERROR()
 #endif
 #endif