A formal PHP RFC proposes a new `.phpc` file extension for pure-code PHP source files that don't require an opening `<?php` tag. The lexer would enter ST_IN_SCRIPTING on the first byte, with UTF-8 BOM and CLI shebang silently skipped. The change is strictly additive — existing `.php` files are unaffected. The reference implementation is ~50 lines of C in the Zend lexer scanner, with 15 new tests and zero regressions across 9836 existing tests. Open issues include the final extension name (`.phpc`, `.phpp`, `.pcode`, or `.phpx`), backward compatibility concerns, security implications for misconfigured webservers, and Phar/OPcache surface coverage. The RFC is in a two-week discussion period on the PHP internals mailing list.

6m read timeFrom externals.io
Post cover image
107 Impressions