phpscript - an inter-operable PHP syntax VM written in Go (no CGO).
Go
11
443 commits
updated Sep 16, 2026
This is a PHP interpreter written in Go. It supports the basic php expression syntax and some parts of the standard library. It's currently rudimentary and only enables limited functionality.
Behaviour is settled by .phpt fixtures: each one is written by running the source through real php first, and phpscript test tests/fixtures/... checks the runtime against that output. The generated test fixture results hold the per-fixture matrix; the bird's-eye view per area:
| Area | Fixtures | Passed | Failed |
|---|---|---|---|
| tests/fixtures/arithmetic | 21 | 21 | 0 |
| tests/fixtures/arrays | 18 | 18 | 0 |
| tests/fixtures/autoloading | 8 | 8 | 0 |
| tests/fixtures/bindings | 23 | 23 | 0 |
| tests/fixtures/errors | 2 | 2 | 0 |
| tests/fixtures/exceptions | 9 | 9 | 0 |
| tests/fixtures/flatstack | 7 | 7 | 0 |
| tests/fixtures/functions | 9 | 9 | 0 |
| tests/fixtures/gd | 7 | 7 | 0 |
| tests/fixtures/includes | 3 | 3 | 0 |
| tests/fixtures/namespaces | 2 | 2 | 0 |
| tests/fixtures/oop | 24 | 24 | 0 |
| tests/fixtures/output | 4 | 4 | 0 |
| tests/fixtures/paths | 2 | 2 | 0 |
| tests/fixtures/regex | 7 | 7 | 0 |
| tests/fixtures/runtime | 11 | 11 | 0 |
| tests/fixtures/stdlib | 17 | 17 | 0 |
| tests/fixtures/strings | 15 | 15 | 0 |
| tests/fixtures/syntax | 8 | 8 | 0 |
| Total | 197 | 197 | 0 |
The Go test run collects a coverage profile, and atkins cover renders it into the generated code coverage report, per package, with the detail per file. The dbadmin demo is measured the same way from a running server, in dbadmin.md.
You can build a docker image from source as follows:
CGO_ENABLED=0 go build -o bin/ .
docker build -t titpetric/phpscript:latest -f docker/Dockerfile .
See ./compose.yml for usage.
Contributions welcome. Open an issue to discuss before opening PRs.
Go
100.0%
phpscript - an inter-operable PHP syntax VM written in Go (no CGO).
Go
11
443 commits
updated Sep 16, 2026
This is a PHP interpreter written in Go. It supports the basic php expression syntax and some parts of the standard library. It's currently rudimentary and only enables limited functionality.
Behaviour is settled by .phpt fixtures: each one is written by running the source through real php first, and phpscript test tests/fixtures/... checks the runtime against that output. The generated test fixture results hold the per-fixture matrix; the bird's-eye view per area:
| Area | Fixtures | Passed | Failed |
|---|---|---|---|
| tests/fixtures/arithmetic | 21 | 21 | 0 |
| tests/fixtures/arrays | 18 | 18 | 0 |
| tests/fixtures/autoloading | 8 | 8 | 0 |
| tests/fixtures/bindings | 23 | 23 | 0 |
| tests/fixtures/errors | 2 | 2 | 0 |
| tests/fixtures/exceptions | 9 | 9 | 0 |
| tests/fixtures/flatstack | 7 | 7 | 0 |
| tests/fixtures/functions | 9 | 9 | 0 |
| tests/fixtures/gd | 7 | 7 | 0 |
| tests/fixtures/includes | 3 | 3 | 0 |
| tests/fixtures/namespaces | 2 | 2 | 0 |
| tests/fixtures/oop | 24 | 24 | 0 |
| tests/fixtures/output | 4 | 4 | 0 |
| tests/fixtures/paths | 2 | 2 | 0 |
| tests/fixtures/regex | 7 | 7 | 0 |
| tests/fixtures/runtime | 11 | 11 | 0 |
| tests/fixtures/stdlib | 17 | 17 | 0 |
| tests/fixtures/strings | 15 | 15 | 0 |
| tests/fixtures/syntax | 8 | 8 | 0 |
| Total | 197 | 197 | 0 |
The Go test run collects a coverage profile, and atkins cover renders it into the generated code coverage report, per package, with the detail per file. The dbadmin demo is measured the same way from a running server, in dbadmin.md.
You can build a docker image from source as follows:
CGO_ENABLED=0 go build -o bin/ .
docker build -t titpetric/phpscript:latest -f docker/Dockerfile .
See ./compose.yml for usage.
Contributions welcome. Open an issue to discuss before opening PRs.
Go
100.0%