From c8955c078a3c58e364f7d94854c75a4f84c3897c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 16 Jan 2023 12:27:33 +0100 Subject: [PATCH] Revert GH-10220 Cf. . This reverts commit ecc880f491d66081298a16634629f149459706a9. This reverts commit 588a07f7371ee2b5fac17de147926780e427fae6. This reverts commit f377e15751d3aa48b69cd9bcc366ede7803d511f. This reverts commit b4ba16fe189b109144aff669e11d81365160104b. This reverts commit 694ec1deea36e366b28b6349a52be49824e1a1a8. This reverts commit 6b34de8eba9f66882ae16e6073af28783670ac53. This reverts commit aa1cd02a4367834026ea2205ea13a2f904455aa1. This reverts commit 308fd311ea6fcf3094b448df7f2b264f08e4fe4f. This reverts commit 16203b53e1822a37b6ba6f2ab198bb435d05fdad. This reverts commit 738fb5ca5412f5e833a7fab82b11519e635a3357. This reverts commit 9fdbefacd3c382d731aa175b7bdc002ec9cb2b30. This reverts commit cd4a7c1d90562ebb5f89caf94d00d579631b9fbe. This reverts commit 928685eba2b2f0ded90e7f78fd806ea164002f6e. This reverts commit 01e5ffc85cd4357fd7b5b7ceefa29f2d10ca26b7. --- Zend/zend.c | 1 - Zend/zend_execute.c | 26 ++++++++++++------- Zend/zend_execute.h | 14 +++------- Zend/zend_execute_API.c | 16 +++++++++--- Zend/zend_fibers.c | 5 ---- Zend/zend_fibers.h | 8 ++---- Zend/zend_ini.c | 4 +-- Zend/zend_ini.h | 12 --------- Zend/zend_multibyte.c | 6 ++--- Zend/zend_multibyte.h | 6 ----- Zend/zend_object_handlers.c | 2 +- Zend/zend_object_handlers.h | 2 -- Zend/zend_operators.c | 8 +++--- Zend/zend_operators.h | 13 +++++----- Zend/zend_ptr_stack.c | 2 +- Zend/zend_ptr_stack.h | 3 --- Zend/zend_signal.c | 11 +++----- Zend/zend_signal.h | 9 ------- Zend/zend_smart_str.c | 4 +-- Zend/zend_smart_str.h | 9 ++----- Zend/zend_smart_str_public.h | 5 ---- Zend/zend_smart_string.h | 5 ++-- Zend/zend_smart_string_public.h | 2 +- Zend/zend_variables.c | 2 +- Zend/zend_variables.h | 1 - ext/intl/collator/collator_is_numeric.c | 3 --- ext/json/json_encoder.c | 1 - ext/json/json_scanner.re | 1 - .../libmbfl/filters/mbfilter_base64.c | 1 - ext/mysqlnd/mysql_float_to_double.h | 1 - ext/mysqlnd/mysqlnd_connection.c | 2 -- ext/mysqlnd/mysqlnd_wireprotocol.c | 1 - ext/oci8/oci8_collection.c | 1 - ext/opcache/jit/zend_jit.c | 4 --- ext/opcache/zend_file_cache.c | 1 - ext/openssl/xp_ssl.c | 2 -- ext/pcre/php_pcre.c | 1 - ext/pdo_pgsql/pgsql_driver.c | 2 -- ext/pgsql/pgsql.c | 1 - ext/phar/phar_object.c | 2 -- ext/random/gammasection.c | 2 -- ext/random/random.c | 1 - ext/random/randomizer.c | 2 -- ext/shmop/shmop.c | 4 +-- ext/soap/php_encoding.c | 2 -- ext/sockets/conversions.c | 1 - ext/sockets/multicast.c | 1 - ext/sockets/sendrecvmsg.c | 2 -- ext/sockets/sockaddr_conv.c | 1 - ext/spl/spl_directory.c | 3 --- ext/standard/array.c | 1 - ext/standard/basic_functions.c | 4 --- ext/standard/dns.c | 3 --- ext/standard/exec.c | 4 --- ext/standard/formatted_print.c | 1 - ext/standard/ftok.c | 4 --- ext/standard/hrtime.c | 1 - ext/standard/mail.c | 2 -- ext/standard/math.c | 1 - ext/standard/net.c | 3 --- ext/standard/php_fopen_wrapper.c | 3 --- ext/standard/proc_open.c | 3 --- ext/standard/streamsfuncs.c | 3 --- ext/standard/var.c | 1 - ext/standard/var_unserializer.re | 1 - ext/sysvmsg/sysvmsg.c | 5 +--- main/main.c | 2 -- main/snprintf.c | 2 +- main/snprintf.h | 3 --- main/spprintf.c | 3 +-- main/spprintf.h | 2 -- main/streams/plain_wrapper.c | 3 --- main/streams/streams.c | 3 --- main/streams/xp_socket.c | 3 --- sapi/cgi/cgi_main.c | 2 -- sapi/cli/php_cli.c | 2 -- sapi/cli/php_cli_server.c | 3 --- sapi/fpm/fpm/fpm_main.c | 3 --- sapi/phpdbg/phpdbg_io.c | 2 -- 79 files changed, 65 insertions(+), 227 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 99d3cc02709..0eec5f89019 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -36,7 +36,6 @@ #include "zend_observer.h" #include "zend_fibers.h" #include "zend_call_stack.h" -#include "zend_strtod.h" #include "Optimizer/zend_optimizer.h" static size_t global_map_ptr_last = 0; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index d1ca0ee62ae..e6fc2a191c0 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -20,25 +20,34 @@ #define ZEND_INTENSIVE_DEBUGGING 0 +#include +#include + +#include "zend.h" +#include "zend_compile.h" #include "zend_execute.h" -#include "zend_API.h" // for ZEND_FUNCTION() -#include "zend_arena.h" +#include "zend_API.h" +#include "zend_ptr_stack.h" #include "zend_constants.h" #include "zend_extensions.h" #include "zend_ini.h" #include "zend_exceptions.h" +#include "zend_interfaces.h" #include "zend_closures.h" -#include "zend_generators.h" // for zend_ce_generator -#include "zend_inheritance.h" // for zend_do_link_class() +#include "zend_generators.h" +#include "zend_vm.h" +#include "zend_dtrace.h" +#include "zend_inheritance.h" +#include "zend_type_info.h" #include "zend_smart_str.h" #include "zend_observer.h" +#include "zend_system_id.h" +#include "zend_call_stack.h" +#include "Optimizer/zend_func_info.h" /* Virtual current working directory support */ #include "zend_virtual_cwd.h" -#include -#include - #ifdef HAVE_GCC_GLOBAL_REGS # if defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(i386) # define ZEND_VM_FP_GLOBAL_REG "%esi" @@ -5339,9 +5348,6 @@ static zend_always_inline zend_execute_data *_zend_vm_stack_push_call_frame(uint /* This callback disables optimization of "vm_stack_data" variable in VM */ ZEND_API void (ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data) = NULL; -#include "zend_fibers.h" // needed by zend_vm_execute.h -#include "zend_interfaces.h" // needed by zend_vm_execute.h -#include "zend_objects.h" // needed by zend_vm_execute.h #include "zend_vm_execute.h" ZEND_API zend_result zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler) diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 40dc4b87f9b..a1e29f5cd0a 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -21,15 +21,10 @@ #ifndef ZEND_EXECUTE_H #define ZEND_EXECUTE_H -#include "zend_compile.h" // for zend_op_array -#include "zend_list.h" // for zend_rsrc_list_get_rsrc_type() -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_execute_data - -#if ZEND_DEBUG -#include "zend_globals.h" // for struct _zend_executor_globals -#include "zend_globals_macros.h" // for EG() -#endif +#include "zend_compile.h" +#include "zend_hash.h" +#include "zend_operators.h" +#include "zend_variables.h" BEGIN_EXTERN_C() struct _zend_fcall_info; @@ -187,7 +182,6 @@ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_with_ctx(zval *pp, zend_class_entry *scope, zend_ast_evaluate_ctx *ctx); /* dedicated Zend executor functions - do not use! */ -typedef struct _zend_vm_stack *zend_vm_stack; struct _zend_vm_stack { zval *top; zval *end; diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 066c45d1eb4..17c3caae214 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -18,18 +18,26 @@ +----------------------------------------------------------------------+ */ +#include +#include + +#include "zend.h" +#include "zend_compile.h" +#include "zend_execute.h" #include "zend_API.h" +#include "zend_stack.h" #include "zend_constants.h" #include "zend_extensions.h" #include "zend_exceptions.h" #include "zend_closures.h" +#include "zend_generators.h" +#include "zend_vm.h" +#include "zend_float.h" #include "zend_fibers.h" #include "zend_weakrefs.h" +#include "zend_inheritance.h" #include "zend_observer.h" - -#include -#include - +#include "zend_call_stack.h" #ifdef HAVE_SYS_TIME_H #include #endif diff --git a/Zend/zend_fibers.c b/Zend/zend_fibers.c index 8638c0f1065..a6168f17fd6 100644 --- a/Zend/zend_fibers.c +++ b/Zend/zend_fibers.c @@ -17,8 +17,6 @@ +----------------------------------------------------------------------+ */ -#include "zend_fibers.h" -#include "zend_objects.h" // for zend_object_std_init() #include "zend.h" #include "zend_API.h" #include "zend_ini.h" @@ -46,9 +44,6 @@ # include # include -# include -# include // for strerror() - # if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) # define MAP_ANONYMOUS MAP_ANON # endif diff --git a/Zend/zend_fibers.h b/Zend/zend_fibers.h index 15f7d43979d..5faa788f4ef 100644 --- a/Zend/zend_fibers.h +++ b/Zend/zend_fibers.h @@ -20,18 +20,14 @@ #ifndef ZEND_FIBERS_H #define ZEND_FIBERS_H -#include "zend_API.h" // for struct zend_fcall_info -#include "zend_portability.h" // for BEGIN_EXTERN_C - -#include +#include "zend_API.h" +#include "zend_types.h" #define ZEND_FIBER_GUARD_PAGES 1 #define ZEND_FIBER_DEFAULT_C_STACK_SIZE (4096 * (((sizeof(void *)) < 8) ? 256 : 512)) #define ZEND_FIBER_VM_STACK_SIZE (1024 * sizeof(zval)) -typedef struct _zend_fiber_context zend_fiber_context; - BEGIN_EXTERN_C() typedef enum { diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 1847a1e7ea0..396d98525c9 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -16,18 +16,16 @@ +----------------------------------------------------------------------+ */ -#include "zend_ini.h" #include "zend.h" #include "zend_sort.h" #include "zend_API.h" +#include "zend_ini.h" #include "zend_alloc.h" #include "zend_operators.h" #include "zend_strtod.h" #include "zend_modules.h" #include "zend_smart_str.h" - #include -#include static HashTable *registered_zend_ini_directives; diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index ebc28de2cad..16189538353 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -19,24 +19,12 @@ #ifndef ZEND_INI_H #define ZEND_INI_H -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_result - -#include - #define ZEND_INI_USER (1<<0) #define ZEND_INI_PERDIR (1<<1) #define ZEND_INI_SYSTEM (1<<2) #define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) -// forward declarations -typedef struct _zend_file_handle zend_file_handle; -typedef struct _zend_ini_entry zend_ini_entry; -typedef struct _zend_module_entry zend_module_entry; -typedef struct _zend_string zend_string; -typedef struct _zend_array HashTable; - #define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage) #define ZEND_INI_DISP(name) ZEND_COLD void name(zend_ini_entry *ini_entry, int type) diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index fc07a2be6af..f8dab668751 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -17,10 +17,10 @@ +----------------------------------------------------------------------+ */ +#include "zend.h" +#include "zend_compile.h" +#include "zend_operators.h" #include "zend_multibyte.h" -#include "zend_alloc.h" -#include "zend_globals.h" // for struct _zend_compiler_globals -#include "zend_globals_macros.h" // for LANG_SCNG() #include "zend_ini.h" static const zend_encoding *dummy_encoding_fetcher(const char *encoding_name) diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h index 08ee6308975..5466840cd90 100644 --- a/Zend/zend_multibyte.h +++ b/Zend/zend_multibyte.h @@ -20,12 +20,6 @@ #ifndef ZEND_MULTIBYTE_H #define ZEND_MULTIBYTE_H -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_result - -#include -#include // for size_t - typedef struct _zend_encoding zend_encoding; typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 923dce59729..c5af76e97b6 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -18,13 +18,13 @@ +----------------------------------------------------------------------+ */ -#include "zend_object_handlers.h" #include "zend.h" #include "zend_globals.h" #include "zend_variables.h" #include "zend_API.h" #include "zend_objects.h" #include "zend_objects_API.h" +#include "zend_object_handlers.h" #include "zend_interfaces.h" #include "zend_exceptions.h" #include "zend_closures.h" diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 4d78c70cf20..79bace92028 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -20,8 +20,6 @@ #ifndef ZEND_OBJECT_HANDLERS_H #define ZEND_OBJECT_HANDLERS_H -#include "zend_types.h" - struct _zend_property_info; #define ZEND_WRONG_PROPERTY_INFO \ diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index e3b899c2b5d..afe068bfeb8 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -18,20 +18,18 @@ +----------------------------------------------------------------------+ */ -#include "zend_operators.h" +#include + #include "zend.h" +#include "zend_operators.h" #include "zend_variables.h" -#include "zend_objects.h" // for zend_objects_new() #include "zend_globals.h" -#include "zend_multiply.h" // for ZEND_SIGNED_MULTIPLY_LONG() #include "zend_list.h" #include "zend_API.h" #include "zend_strtod.h" #include "zend_exceptions.h" #include "zend_closures.h" -#include - #include #ifdef HAVE_LANGINFO_H # include diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index f448c7bd567..506c27fc50e 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -21,19 +21,20 @@ #ifndef ZEND_OPERATORS_H #define ZEND_OPERATORS_H -#include "zend_hash.h" // for zend_hash_num_elements() -#include "zend_object_handlers.h" // for struct _zend_object_handlers -#include "zend_portability.h" // for BEGIN_EXTERN_ -#include "zend_types.h" // for zend_result -#include "zend_string.h" // for zend_string_copy() - +#include #include +#include #include #ifdef HAVE_IEEEFP_H #include #endif +#include "zend_portability.h" +#include "zend_strtod.h" +#include "zend_multiply.h" +#include "zend_object_handlers.h" + #define LONG_SIGN_MASK ZEND_LONG_MIN BEGIN_EXTERN_C() diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index acecae477e3..80c77e11d73 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -17,8 +17,8 @@ +----------------------------------------------------------------------+ */ +#include "zend.h" #include "zend_ptr_stack.h" - #include ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent) diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index b1dc6c29af3..1126da5800d 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -20,9 +20,6 @@ #ifndef ZEND_PTR_STACK_H #define ZEND_PTR_STACK_H -#include "zend_alloc.h" // for safe_perealloc() -#include "zend_portability.h" // for BEGIN_EXTERN_C - typedef struct _zend_ptr_stack { int top, max; void **elements; diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c index 8fd55942f86..aa74bdd147c 100644 --- a/Zend/zend_signal.c +++ b/Zend/zend_signal.c @@ -28,15 +28,12 @@ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif - -#include "zend_signal.h" -#include "zend_alloc.h" -#include "zend.h" // for zend_output_debug_string(), zend_error(), ... - -#include -#include #include +#include "zend.h" +#include "zend_globals.h" +#include + #ifdef HAVE_UNISTD_H #include #endif diff --git a/Zend/zend_signal.h b/Zend/zend_signal.h index 53ef58fa53f..93edc1f0e02 100644 --- a/Zend/zend_signal.h +++ b/Zend/zend_signal.h @@ -21,18 +21,9 @@ #ifndef ZEND_SIGNAL_H #define ZEND_SIGNAL_H -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include "php_config.h" // for ZEND_SIGNALS -#endif - #ifdef ZEND_SIGNALS -#include "zend_portability.h" // for BEGIN_EXTERN_C - #include -#include #ifndef NSIG #define NSIG 65 diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c index 689989059c2..5132043c60e 100644 --- a/Zend/zend_smart_str.c +++ b/Zend/zend_smart_str.c @@ -14,11 +14,9 @@ +----------------------------------------------------------------------+ */ +#include #include "zend_smart_str.h" #include "zend_smart_string.h" -#include "zend_globals_macros.h" // for EG() -#include "zend_globals.h" // struct _zend_executor_globals -#include "zend_strtod.h" // for zend_gcvt() #define SMART_STR_OVERHEAD (ZEND_MM_OVERHEAD + _ZSTR_HEADER_SIZE + 1) #define SMART_STR_START_SIZE 256 diff --git a/Zend/zend_smart_str.h b/Zend/zend_smart_str.h index ac5b18db97e..e271835e41d 100644 --- a/Zend/zend_smart_str.h +++ b/Zend/zend_smart_str.h @@ -17,15 +17,10 @@ #ifndef ZEND_SMART_STR_H #define ZEND_SMART_STR_H +#include +#include "zend_globals.h" #include "zend_smart_str_public.h" -#include "zend_operators.h" // for zend_print_long_to_buf() -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_string.h" - -// forward declarations -typedef struct _zval_struct zval; - BEGIN_EXTERN_C() ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len); diff --git a/Zend/zend_smart_str_public.h b/Zend/zend_smart_str_public.h index 84fc3758ae7..e81a6839b3b 100644 --- a/Zend/zend_smart_str_public.h +++ b/Zend/zend_smart_str_public.h @@ -17,11 +17,6 @@ #ifndef ZEND_SMART_STR_PUBLIC_H #define ZEND_SMART_STR_PUBLIC_H -#include // for size_t - -// forward declarations -typedef struct _zend_string zend_string; - typedef struct { /** See smart_str_extract() */ zend_string *s; diff --git a/Zend/zend_smart_string.h b/Zend/zend_smart_string.h index 08eb6a8eced..8149b29fb33 100644 --- a/Zend/zend_smart_string.h +++ b/Zend/zend_smart_string.h @@ -20,9 +20,8 @@ #include "zend_smart_string_public.h" -#include "zend_alloc.h" // for pefree() -#include "zend_operators.h" // for zend_print_long_to_buf() -#include "zend_portability.h" // for ZEND_FASTCALL +#include +#include /* wrapper */ diff --git a/Zend/zend_smart_string_public.h b/Zend/zend_smart_string_public.h index e61bdd2d36f..543e1d37a4e 100644 --- a/Zend/zend_smart_string_public.h +++ b/Zend/zend_smart_string_public.h @@ -18,7 +18,7 @@ #ifndef PHP_SMART_STRING_PUBLIC_H #define PHP_SMART_STRING_PUBLIC_H -#include // for size_t +#include typedef struct { char *c; diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 69cb54dbc7d..06483d581df 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -#include "zend_variables.h" +#include #include "zend.h" #include "zend_API.h" #include "zend_ast.h" diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index c07fdfe7acf..ea3fd9c5efc 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -21,7 +21,6 @@ #ifndef ZEND_VARIABLES_H #define ZEND_VARIABLES_H -#include "zend_hash.h" // for zend_array_dup() #include "zend_types.h" #include "zend_gc.h" diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index 0f6c216502d..823fb4088d8 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -14,9 +14,6 @@ */ #include "collator_is_numeric.h" -#include "zend_strtod.h" - -#include /* {{{ Taken from PHP6:zend_u_strtod() */ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */ diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index a3e136ec9b5..adb53598326 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -28,7 +28,6 @@ #include "php_json_encoder.h" #include #include "zend_enum.h" -#include "zend_strtod.h" // for ZEND_DOUBLE_MAX_LENGTH static const char digits[] = "0123456789abcdef"; diff --git a/ext/json/json_scanner.re b/ext/json/json_scanner.re index 014f29bd564..1db43dd081a 100644 --- a/ext/json/json_scanner.re +++ b/ext/json/json_scanner.re @@ -18,7 +18,6 @@ #include "php_json_scanner.h" #include "php_json_scanner_defs.h" #include "php_json_parser.h" -#include "zend_strtod.h" #include "json_parser.tab.h" #define YYCTYPE php_json_ctype diff --git a/ext/mbstring/libmbfl/filters/mbfilter_base64.c b/ext/mbstring/libmbfl/filters/mbfilter_base64.c index bc06c6a1abf..ede3eef18ce 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_base64.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_base64.c @@ -30,7 +30,6 @@ #include "mbfilter.h" #include "mbfilter_base64.h" -#include "zend_multiply.h" // for zend_safe_address_guarded() static size_t mb_base64_to_wchar(unsigned char **in, size_t *in_len, uint32_t *buf, size_t bufsize, unsigned int *state); static void mb_wchar_to_base64(uint32_t *in, size_t len, mb_convert_buf *buf, bool end); diff --git a/ext/mysqlnd/mysql_float_to_double.h b/ext/mysqlnd/mysql_float_to_double.h index b868aa67aa4..a15458b52de 100644 --- a/ext/mysqlnd/mysql_float_to_double.h +++ b/ext/mysqlnd/mysql_float_to_double.h @@ -20,7 +20,6 @@ #include "main/php.h" #include #include "main/snprintf.h" -#include "zend_strtod.h" #define MAX_CHAR_BUF_LEN 255 diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 666ab666215..ed4d1af277d 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -30,8 +30,6 @@ #include "mysqlnd_ext_plugin.h" #include "zend_smart_str.h" -#include -#include // for strerror() extern MYSQLND_CHARSET *mysqlnd_charsets; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 25f178e0b57..fce042ec5be 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -23,7 +23,6 @@ #include "mysqlnd_wireprotocol.h" #include "mysqlnd_statistics.h" #include "mysqlnd_debug.h" -#include "zend_strtod.h" #define BAIL_IF_NO_MORE_DATA \ if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \ diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index b3529354b8a..dcad3356475 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -35,7 +35,6 @@ #include "php_oci8.h" #include "php_oci8_int.h" -#include "zend_strtod.h" /* {{{ php_oci_collection_create() Create and return connection handle */ diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index b7af6f83d31..429d8dbd49f 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -51,10 +51,6 @@ #include #endif -#ifdef HAVE_MPROTECT -#include -#endif - #ifdef ZTS int jit_globals_id; #else diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index f98bd66fa04..1cd639403f6 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -42,7 +42,6 @@ #include #include -#include #include #if HAVE_UNISTD_H diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index d245fab5a78..04807680892 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -36,8 +36,6 @@ #include #include -#include - #ifdef PHP_WIN32 #include "win32/winutil.h" #include "win32/time.h" diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 099e1e5bbbc..f4fd60e96eb 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -20,7 +20,6 @@ #include "php_pcre.h" #include "ext/standard/info.h" #include "ext/standard/basic_functions.h" -#include "zend_multiply.h" // for zend_safe_address_guarded() #include "zend_smart_str.h" #include "SAPI.h" diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index cdd9b6ddae3..ec4d5ec6586 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -34,8 +34,6 @@ #include "zend_exceptions.h" #include "pgsql_driver_arginfo.h" -#include - static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh); static char * _pdo_pgsql_trim_message(const char *message, int persistent) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 0679b2b6c46..00bdf15286e 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -39,7 +39,6 @@ #include "php_pgsql.h" #include "php_globals.h" #include "zend_exceptions.h" -#include "zend_strtod.h" #ifdef HAVE_PGSQL diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index b00326182e7..0737c0db9f3 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -21,8 +21,6 @@ #include "func_interceptors.h" #include "phar_object_arginfo.h" -#include - static zend_class_entry *phar_ce_archive; static zend_class_entry *phar_ce_data; static zend_class_entry *phar_ce_PharException; diff --git a/ext/random/gammasection.c b/ext/random/gammasection.c index b8d32c3c2fe..aa4531fba22 100644 --- a/ext/random/gammasection.c +++ b/ext/random/gammasection.c @@ -24,8 +24,6 @@ #include "php_random.h" #include -#include // for DBL_MAX - /* This file implements the γ-section algorithm as published in: * * Drawing Random Floating-Point Numbers from an Interval. Frédéric diff --git a/ext/random/random.c b/ext/random/random.c index cfa32ee0ba1..cdc98fbf242 100644 --- a/ext/random/random.c +++ b/ext/random/random.c @@ -41,7 +41,6 @@ # include #else # include -# include #endif #ifdef __linux__ diff --git a/ext/random/randomizer.c b/ext/random/randomizer.c index 23860ada8a2..75e88c8b010 100644 --- a/ext/random/randomizer.c +++ b/ext/random/randomizer.c @@ -27,8 +27,6 @@ #include "Zend/zend_enum.h" #include "Zend/zend_exceptions.h" -#include // for DBL_MANT_DIG - static inline void randomizer_common_init(php_random_randomizer *randomizer, zend_object *engine_object) { if (engine_object->ce->type == ZEND_INTERNAL_CLASS) { /* Internal classes always php_random_engine struct */ diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index dfb301788dd..be4f57ad271 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -33,13 +33,11 @@ #include "tsrm_win32.h" #endif + #ifdef HAVE_SHMOP #include "ext/standard/info.h" -#include -#include // for strerror() - /* {{{ shmop_module_entry */ zend_module_entry shmop_module_entry = { STANDARD_MODULE_HEADER, diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 6fc81d30686..3b7d6c3885d 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -25,8 +25,6 @@ #include "zend_strtod.h" #include "zend_interfaces.h" -#include - /* zval type decode */ static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data); static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data); diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index bb314b4bb4d..ae90cbe59d2 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -24,7 +24,6 @@ # include #endif -#include #include #include #include diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 00e7b8f0488..ef32661be09 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -39,7 +39,6 @@ #include "sockaddr_conv.h" #include "main/php_network.h" -#include enum source_op { JOIN_SOURCE, diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index eac78bda413..5623b556aa0 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -28,8 +28,6 @@ #include #endif -#include - #define MAX_USER_BUFF_SIZE ((size_t)(100*1024*1024)) #define DEFAULT_BUFF_SIZE 8192 #define MAX_ARRAY_KEY_SIZE 128 diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 2e8686bf5ab..6ec540931f7 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -5,7 +5,6 @@ #ifdef PHP_WIN32 #include "windows_common.h" #else -#include #include #include #endif diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index fc806b457a1..5c32e2f9ee3 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -36,9 +36,6 @@ #include "spl_directory_arginfo.h" #include "spl_exceptions.h" -#include -#include // for strerror() - #define SPL_HAS_FLAG(flags, test_flag) ((flags & test_flag) ? 1 : 0) /* declare the class handlers */ diff --git a/ext/standard/array.c b/ext/standard/array.c index c8afc08cffa..b6650284cad 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -40,7 +40,6 @@ #include "zend_smart_str.h" #include "zend_bitset.h" #include "zend_exceptions.h" -#include "zend_strtod.h" #include "ext/spl/spl_array.h" #include "ext/random/php_random.h" diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 4e10cac38c7..f65a71a7266 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -117,10 +117,6 @@ PHPAPI php_basic_globals basic_globals; #include "streamsfuncs.h" #include "basic_functions_arginfo.h" -#if defined(HAVE_NANOSLEEP) || !defined(PHP_WIN32) -#include -#endif - typedef struct _user_tick_function_entry { zend_fcall_info fci; zend_fcall_info_cache fci_cache; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index a5a5d86483e..d229b998a4b 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -57,9 +57,6 @@ extern void __res_ndestroy(res_state statp); #endif #endif -#include -#include // for strerror() - #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 255 #endif diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 108c7d282f8..1b1b0ab9e9c 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -46,10 +46,6 @@ #include #endif -#ifdef HAVE_NICE -#include -#endif - #include #ifdef PHP_WIN32 diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index a98d410a228..b988422df21 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -19,7 +19,6 @@ #include "ext/standard/head.h" #include "php_string.h" #include "zend_execute.h" -#include "zend_strtod.h" // for zend_gcvt() #include #include diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index d00dd6d75e5..1a046b3de69 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -27,10 +27,6 @@ #endif #ifdef HAVE_FTOK - -#include -#include // for strerror() - /* {{{ Convert a pathname and a project identifier to a System V IPC key */ PHP_FUNCTION(ftok) { diff --git a/ext/standard/hrtime.c b/ext/standard/hrtime.c index 5fe4f950f31..7dca135c920 100644 --- a/ext/standard/hrtime.c +++ b/ext/standard/hrtime.c @@ -17,7 +17,6 @@ #include "php.h" #include "hrtime.h" -#include "zend_strtod.h" /* {{{ */ /* This file reuses code parts from the cross-platform timer library diff --git a/ext/standard/mail.c b/ext/standard/mail.c index b5e7efe8e45..55790e6100f 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -44,8 +44,6 @@ #ifdef PHP_WIN32 # include "win32/sendmail.h" -#else -# include #endif #define SKIP_LONG_HEADER_SEP(str, pos) \ diff --git a/ext/standard/math.c b/ext/standard/math.c index 5b2d74a2de9..ad2823ea49b 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -23,7 +23,6 @@ #include "zend_exceptions.h" #include "zend_portability.h" #include "zend_bitset.h" -#include "zend_strtod.h" #include #include diff --git a/ext/standard/net.c b/ext/standard/net.c index 83d3e217042..b22f304c8eb 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -47,9 +47,6 @@ # include #endif -#include -#include // for strerror() - PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) { socklen_t addrlen = sizeof(struct sockaddr_in); diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 8f70ba2094c..8926485025a 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -29,9 +29,6 @@ #include "php_fopen_wrappers.h" #include "SAPI.h" -#include -#include // for strerror() - static ssize_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { PHPWRITE(buf, count); diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 4281be769da..53ec6faa101 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -36,9 +36,6 @@ #include #endif -#include -#include // for strerror() - /* This symbol is defined in ext/standard/config.m4. * Essentially, it is set if you HAVE_FORK || PHP_WIN32 * Other platforms may modify that configure check and add suitable #ifdefs diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 5af3ec3d638..ac2c777eea5 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -40,9 +40,6 @@ typedef unsigned long long php_timeout_ull; typedef unsigned __int64 php_timeout_ull; #endif -#include -#include // for strerror() - #define GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), wrapper, name))) static php_stream_context *decode_context_param(zval *contextresource); diff --git a/ext/standard/var.c b/ext/standard/var.c index 70747450998..7c6f79aba75 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -28,7 +28,6 @@ #include "php_incomplete_class.h" #include "zend_enum.h" #include "zend_exceptions.h" -#include "zend_strtod.h" // for zend_gcvt() /* }}} */ struct php_serialize_data { diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 1fe37e11ebd..62f9aa43639 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -19,7 +19,6 @@ #include "php_incomplete_class.h" #include "zend_portability.h" #include "zend_exceptions.h" -#include "zend_strtod.h" /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1018 /* 1024 - offsetof(php_unserialize_data, entries) / sizeof(void*) */ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index caaa5eccef3..debb8b675b0 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -22,13 +22,10 @@ #include "php_globals.h" #include "ext/standard/info.h" #include "php_sysvmsg.h" +#include "sysvmsg_arginfo.h" #include "ext/standard/php_var.h" #include "zend_smart_str.h" -#include -#include "sysvmsg_arginfo.h" - -#include // for strerror() #include #include #include diff --git a/main/main.c b/main/main.c index 17da657d177..2605e554c7c 100644 --- a/main/main.c +++ b/main/main.c @@ -82,8 +82,6 @@ #include "rfc1867.h" #include "ext/standard/html_tables.h" - -#include // for DBL_*, used by main_arginfo.h #include "main_arginfo.h" /* }}} */ diff --git a/main/snprintf.c b/main/snprintf.c index d00fb83286e..3c379c5c2ce 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -17,7 +17,7 @@ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif -#include "snprintf.h" +#include "php.h" #include diff --git a/main/snprintf.h b/main/snprintf.h index 99c746d994a..2ff7116c3fb 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -66,9 +66,6 @@ Example: #ifndef SNPRINTF_H #define SNPRINTF_H -#include "php.h" // for PHPAPI -#include "zend_portability.h" // for BEGIN_EXTERN_C - #include BEGIN_EXTERN_C() diff --git a/main/spprintf.c b/main/spprintf.c index f4faf0d894c..37b81dc6d53 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -75,8 +75,7 @@ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif -#include "spprintf.h" -#include "zend_strtod.h" +#include "php.h" #include #include diff --git a/main/spprintf.h b/main/spprintf.h index 73d9286d474..4da224845b3 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -18,8 +18,6 @@ #define SPPRINTF_H #include "snprintf.h" -#include "php.h" // for PHPAPI -#include "zend_portability.h" // for BEGIN_EXTERN_C #include "zend_smart_str_public.h" #include "zend_smart_string_public.h" diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index a7013a6f8fb..e9a30f33340 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -42,9 +42,6 @@ # include "win32/readdir.h" #endif -#include -#include // for strerror() - #define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC) #define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC) #define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC) diff --git a/main/streams/streams.c b/main/streams/streams.c index fc167a28728..1231dbebd63 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -32,9 +32,6 @@ #include #include "php_streams_int.h" -#include -#include // for strerror() - /* {{{ resource and registration code */ /* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */ static HashTable url_stream_wrappers_hash; diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index aa10f598d62..3a4beca9f07 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -25,11 +25,8 @@ #ifdef AF_UNIX #include -#include // for strerror() #endif -#include - #ifndef MSG_DONTWAIT # define MSG_DONTWAIT 0 #endif diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f4f37537e72..b45468031fc 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -95,8 +95,6 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; # include "valgrind/callgrind.h" #endif -#include - #ifndef PHP_WIN32 /* XXX this will need to change later when threaded fastcgi is implemented. shane */ struct sigaction act, old_term, old_quit, old_int; diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index c2c91574d57..cc9a26c4138 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -92,8 +92,6 @@ # include "openssl/applink.c" #endif -#include - PHPAPI extern char *php_ini_opened_path; PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 5bc1cd4683f..901281ddfdf 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -106,9 +106,6 @@ #include "php_cli_process_title.h" #include "php_cli_process_title_arginfo.h" -#include -#include // for strerror() - #define OUTPUT_NOT_CHECKED -1 #define OUTPUT_IS_TTY 1 #define OUTPUT_NOT_TTY 0 diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 0e939986314..0a61abacd70 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -93,9 +93,6 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; #include "fpm_log.h" #include "zlog.h" -#include -#include // for strerror() - /* XXX this will need to change later when threaded fastcgi is implemented. shane */ struct sigaction act, old_term, old_quit, old_int; diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index 6cf827c1be0..14ae71a0ebd 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -20,8 +20,6 @@ #include "phpdbg_io.h" -#include - ZEND_EXTERN_MODULE_GLOBALS(phpdbg) /* is easy to generalize ... but not needed for now */