---
title: "[RFC] Pure-code source files via the .phpc extension"
url: https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-gwyce5amq
source_url: https://externals.io/message/131346
type: article
source: "externals.io"
published: 2026-06-17T12:28:57.762Z
updated: 2026-06-17T12:29:21.313Z
tags: ["php", "language-design"]
reading_time: 47
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[externals.io](https://daily.dev/sources/externals)** · 47 min read · 0 upvotes · 0 comments

## Summary

A PHP internals 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 opt-in and additive — existing .php files are completely unaffected. The reference 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 concerns, and security implications around misconfigured web servers serving the new extension.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131346>

## Similar posts on daily.dev

- [\[RFC\] Pure-code source files via the .phpc extension](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-2qac9kutf) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Pure-code source files via the .phpc extension](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-jjlzpwyl5) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Pure-code source files via the .phpc extension](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-swtt7sypx) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Pure-code source files via the .phpc extension](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-r64xmy6u5) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Pure-code source files via the .phpc extension](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-mvikxszyp) · externals.io · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#language-design](https://daily.dev/tags/language-design)

[View this post on daily.dev](https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-gwyce5amq)
