🧪 PHP being written in... PHP?
Marcos Marcolin • April 1, 2025 • 1 min read
php phpsrc opensourceA recent PoC (proof of concept) in PHP's Core caught my attention: implementing internal functions using pure PHP, instead of C.
Link to the proposal (PoC): PR 18204.
A practical example was rewriting some array_*() functions entirely in PHP.
Yes, PHP implementing parts of PHP itself.
The goal isn't to replace C, after all, the language's interpreter is written in it, but to make room for some internal functions to be written directly in PHP, without meaningfully impacting performance.
This can:
- Reduce complexity
- Make collaboration easier
- Make internal code more accessible (including for IDEs)
- Lower maintenance costs and the chance of bugs
In practice, this breaks down a barrier that exists today for people who want to contribute to the Core but aren't very familiar with C, systems, or compilers.
Of course: it's still a proof of concept and is under discussion.