phrep

alternatives
Login

There are other preprocessor implementions for / or usable with PHP.

phpp

PHPP is meant for PHP scripts of course.

Quite apt for joining PHP apps.

CCPP

CCPP is an earlier C-preprocessor implementation for PHP.

It's just a library though, not being updated since.

Preprocess.py

preprocess is a very generic file preprocessor implemented in Python.

It's available in most distros per default.

other PHP-specific processors

Don't refrain from adding a comment if you know of another implementation.

GPP (General-Purpose Preprocessor)

GPP is similar to the C preprocessor, but provides a few abstractions and flexibility over CPP and M4.

It's not an active project anymore, but still functional, readily available in all distros.

CPP (GNU or Clang)

Theoretically one could use plain cpp for preprocessing other source files. It's quite the command-line though:

gcc -E -P -w -ansi -traditional-cpp -no-integrated-cpp -nostdinc -iconfig.h file.php

CPP however is too strongly tied to C/C++ and will trip over literal # comments, and often butcher up the rest (stripping comments is useless outside of C compiling tasks).