A formal PHP RFC proposes a new .phpc file extension that allows PHP files to be parsed as pure code without requiring the opening <?php tag. The lexer would enter ST_IN_SCRIPTING on the first byte, silently skipping UTF-8 BOMs and CLI shebangs. The change is strictly additive — existing .php files are unaffected. The implementation is ~50 lines of C in the Zend lexer with 15 new tests and zero regressions across 9836 existing tests. Community feedback is mixed: some see it as unnecessary complexity since <?php is only 5 characters, while the author argues PHP is the only modern mainstream language requiring such an opener for pure-code files. Open issues include the final extension name (.phpc/.phpp/.pcode/.phpx), backward compatibility, and webserver security configuration for the new extension.

36m read timeFrom externals.io
Post cover image
82 Impressions