Skip to content

Commit 6231dc9

Browse files
committed
refact - improve docs
1 parent d5da159 commit 6231dc9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

llms.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,20 @@
3232

3333
## Running tests
3434

35+
## PHP version compatibility
36+
37+
- Treat **PHP 5.6** as the minimum supported runtime for any code changes in this repo.
38+
- New formatter logic should avoid syntax/features newer than PHP 5.6 (e.g. scalar type hints, return types, null coalescing `??`, spaceship `<=>`, arrow functions, etc.).
39+
- Some fixtures and passes are intentionally **version-gated** (e.g. PHP 8 attributes, `match`, etc.) and will be skipped when running under older runtimes.
40+
3541
### 1) Fixture tests (`.in`/`.out`)
3642

3743
- Run the full fixture suite:
3844
- From `tests/`: `php ./run_all_tests.php`
45+
46+
- If you don’t have PHP 5.6 locally, validate compatibility by running with PHP 7.4:
47+
- `php74 tests/run_all_tests.php`
48+
- If your system uses `php7.4` instead: `php7.4 tests/run_all_tests.php`
3949
- Run a subset by test number prefix:
4050
- `php ./run_all_tests.php --testNumber 525`
4151
- Show diffs (verbose):
@@ -73,6 +83,14 @@
7383
- Run from the repository root:
7484
- `./vendor/bin/phpunit`
7585

86+
- Under PHP 7.4 (if available):
87+
- `php74 ./vendor/bin/phpunit`
88+
89+
Notes:
90+
- The **fixture harness** (`tests/run_all_tests.php`) is the primary “hard gate” for formatter behavior and should stay at `Broken:0`.
91+
- Under older runtimes (e.g. PHP 7.4), PHPUnit may report many **Skipped** tests due to runtime/dependency constraints; this is expected.
92+
- Prefer running PHPUnit with the default `php` (newer runtime) for full coverage, and use `php74 tests/run_all_tests.php` as the compatibility proxy.
93+
7694
## Creating a new fixture test (`.in`/`.out`)
7795

7896
1) Pick a new number
@@ -100,6 +118,9 @@
100118
- `php tests/run_all_tests.php`
101119
- `./vendor/bin/phpunit`
102120

121+
- Also run the fixture suite with PHP 7.4 when possible (as a proxy for older runtimes):
122+
- `php74 tests/run_all_tests.php`
123+
103124
## Debugging tips
104125

105126
- To see which passes execute, use `FMTDEBUG` (see conditions in `fmt.stub.php`).

0 commit comments

Comments
 (0)