Skip to content

Conversation

@khaledalam
Copy link

@khaledalam khaledalam commented Jan 29, 2026

Description

Remove 26 duplicate #include statements from 21 files across the codebase.

Motivation

  • Improves code clarity by removing visual noise
  • Makes dependency graphs cleaner for static analysis tools
  • Aligns with coding standards for maintainable code

Compile-Time Impact

Removes 26 redundant file lookups and preprocessor guard evaluations during compilation.

Changes

Directory Files Modified
Zend/ 3
main/ 2
sapi/ 10
ext/ 6

Notable duplicates removed:

  • php.h, php_globals.h in SAPI files
  • zend_vm_opcodes.h in zend_compile.h
  • http_core.h in apache2handler (3 files)
  • <sys/types.h> in multiple wrappers

Notes

  • All removed includes were true duplicates (unconditional, same file)
  • Excludes intentional duplicates in #if/#elif branches
  • No functional changes - include guards already prevented reprocessing

Copy link
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked all files, mostly looks good but one file has issues

@khaledalam
Copy link
Author

Thanks @DanielEScherzer for the feedback, yes I were try to be careful about exclude conditional ones but i missed that file.

Copy link
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants