<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj" -->

---
title: [RFC] Pure-code source files via the .phpc extension
description: A formal PHP RFC proposes a new `.phpc` file extension that allows PHP files to be parsed as pure code without requiring the `&lt;?php` opening tag. The lexer...
canonical: https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [RFC] Pure-code source files via the .phpc extension | daily.dev
og:description: A formal PHP RFC proposes a new `.phpc` file extension that allows PHP files to be parsed as pure code without requiring the `&lt;?php` opening tag. The lexer...
og:url: https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj
og:image: https://api.daily.dev/og/posts/LxbFacmWJ.png
og:image:alt: [RFC] Pure-code source files via the .phpc extension
og:image:width: 1200
og:image:height: 630
og:locale: 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)** · 14 min read · 0 upvotes · 0 comments

## Summary

A formal PHP RFC proposes a new `.phpc` file extension that allows PHP files to be parsed as pure code without requiring the `<?php` opening tag. The lexer would enter scripting mode on the first byte, with UTF-8 BOM and CLI shebangs silently skipped. The change is strictly additive (~50 lines of C in the Zend lexer), leaving `.php` files completely untouched. The RFC addresses prior feedback on engine-vs-SAPI dispatch, backward compatibility, security risks (source exposure via misconfigured webservers), and alternative approaches. Community discussion is mixed: some see it as unnecessary complexity with no real-world benefit since `<?php` already works, 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), Windows/macOS case-sensitivity, and Phar/OPcache surface testing.

## Full article

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

## 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-fhmaogjx2) · 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-f3g3bengk) · 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-1vuuvtj3a) · 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-ks1n1v9qm) · 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-vab1etgtt) · 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-lxbfacmwj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[RFC] Pure-code source files via the .phpc extension","url":"https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj"},"datePublished":"2026-06-16T04:26:15.927Z","dateModified":"2026-06-16T04:26:40.197Z","description":"A formal PHP RFC proposes a new `.phpc` file extension that allows PHP files to be parsed as pure code without requiring the `<?php` opening tag. The lexer...","image":"https://media.daily.dev/image/upload/s--foaA6JGU--/f_auto/v1722860399/public/Placeholder%2004","thumbnailUrl":"https://media.daily.dev/image/upload/s--foaA6JGU--/f_auto/v1722860399/public/Placeholder%2004","isAccessibleForFree":true,"articleSection":"externals.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rfc-pure-code-source-files-via-the-phpc-extension-lxbfacmwj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,language-design","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[RFC] Pure-code source files via the .phpc extension"}]}
```

