If the hit isn't significant, this might be a way forward. There is the BC break that files fed through the parser with nothing to parse will start creating errors, but that situation (a php file with no <?php at all) feels like an error state anyway. Thoughts?
It is wrong to assume a PHP file always contains PHP code. Many PHP files only contain HTML just because it is totally valid to do so. Then the question is how to handle pure no-code files.
Rasmus (Lerdorf, PHP's creator) likes to point out that PHP has the shortest "hello world application" of any non-esoteric language:
Hello, World!
More realistically, I just checked the codebase I work on with "ack" (a grep replacement):
ack --php -L '<?'
That found 14 files which will be run as PHP but don't contain the string "<?". Some of those are empty files, but about half are "templates" which happen not to have any dynamic content.
So yeah, it would be an entirely unnecessary disruption to perfectly good code.
Regards,
Rowan Tommins
[IMSoP]