# [Pre-RFC] Pure-code source files via .phpc extension

- Thread: https://externals.io/message/131138
- Original archive: https://news-web.php.net/php.internals/131138
- Started by Jordi Kroon on 2026-06-04T14:34:31+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #131138 — Jordi Kroon — 2026-06-04T14:34:31+00:00

URL: https://externals.io/message/131138#131138

> Question - what is the performance hit of scanning the file for <?php 
> and, if none are found, restarting the parse process in code mode?
> 
> 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.

Additionally you would also need to scan for the <?= (short open tag).

As others have mentioned a potential RFC would provide unncessary 
security and BC risks. That would most likely only surprise users. So I 
don't really see the real benefit of it.


-- 
Regards,

Jordi Kroon
