# EBNF

- Thread: https://externals.io/message/132487
- Original archive: https://news-web.php.net/php.internals/132487
- Started by Alwyn Bester on 2026-09-13T08:40:32+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

---

## #132487 — Alwyn Bester — 2026-09-13T08:40:32+00:00

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

> Dear internals
 >
 > After enviously looking at pythons grammar
 > (http://docs.python.org/dev/reference/grammar.html) I keep feeling
 > that PHP is missing out on a lot of interesting meta projects by not
 > having an official EBNF.
 >
 > Building your own PHP parser is _very_ hard and is PhD (Paul Biggar:)
 > level stuff if you wan't to get all the edge cases right. Having _the_
 > official EBNF would make this easier.
 >
 > I know there is a lot of historical reasons for this and that creating
 > and maintaing said EBNF is a very serious task, one that is maybe too
 > big for a non-paying open source project.
 >
 > But still I have to ask if I'm the only one thinking about this or is
 > there something I'm being completely ignorant about?
 >
 > Happy newyear!
 > Rune Kaagaard

I see this post is already 15 years old, but having a well defined EBNF 
grammar for PHP would invaluable for 3rd party tool designers.

We have just recently completed the first EBNF mapping for PHP 8.5 from 
source code, and plan to also map all future versions of PHP. I

If there is enough interest we will also consider mapping older versions 
of PHP.

You can browse, and download the EBNF in machine-readable and human 
reabile format from this website:
https://zoclee.com/php-grammar

or from the GitHub repository at
https://github.com/zoclee/php-grammar

-- 
{Zoclee}

Kind regards,

Alwyn Bester
