# PHP 8.5.12 Compatibility — Verification Record

The NH POS backend, the React frontend, WordPress and the VMWebs Commerce plugin were verified against
**PHP 8.5.12** (WAMP, x64, ZTS/thread-safe, VC2022). **No application code changes were required** — the
codebase is Laravel 13 with a `php: ^8.3` constraint, which already forward-supports 8.5.x. The minimum
supported version is deliberately kept at **8.3** so the master branch stays compatible with PHP 8.3, 8.4
and 8.5 (do not raise it to 8.5 just because dev uses 8.5.12).

## Environment
- **Apache** loads `bin/php/php8.5.12.1/php8apache2_4.dll` → Apache runs **PHP 8.5.12**.
- **CLI** default on PATH is 8.3.28; the global PATH is deliberately left unchanged (PHP 8.3 stays
  installed). Use the project-local wrapper scripts below, which pin the verified 8.5.12 binary.
- **MySQL** 8.4.7; databases `nh_pos_db` (dev), `nh_pos_test` (tests), `nh_wordpress` (WordPress).

## Development commands (explicit PHP 8.5.12)
`backend/scripts/*.cmd` dispatch to the 8.5.12 binary without touching the global PATH. They resolve
`C:\wamp64\bin\php\php8.5.12.1\php.exe` by default; override per shell with `set NH_POS_PHP=…` (and
`set NH_POS_COMPOSER=…` for a non-default composer.phar). From `backend/`:

| Command | Runs |
| --- | --- |
| `scripts\php-version` | **verify** the active runtime — prints `CLI PHP 8.5.12 (64-bit, ZTS)` |
| `scripts\php …` | arbitrary PHP on 8.5.12 (e.g. `scripts\php -m`) |
| `scripts\artisan …` | Artisan on 8.5.12 (e.g. `scripts\artisan migrate:status`) |
| `scripts\test …` | PHPUnit on 8.5.12 (xdebug off, 3G memory; passes through any phpunit args) |
| `scripts\composer …` | Composer on the 8.5.12 runtime (so platform checks use the intended PHP) |
| `scripts\queue …` | `queue:work` on 8.5.12 |

Verify the active version at any time with **`scripts\php-version`** (or `scripts\php -v`). Apache's
version is confirmed via WAMP's left-click menu → PHP, or the `php8apache2_4.dll` line in `httpd.conf`.

## Extensions (all present on 8.5.12)
pdo_mysql, mysqli, mbstring, openssl, curl, fileinfo, intl, gd, zip, xml, dom, simplexml, sodium, bcmath,
tokenizer, ctype, json (plus exif, gmp, soap, xsl, opcache, and the new `uri`/`lexbor` built-ins).

## Composer
- `composer validate` → valid. `check-platform-reqs` → all `success` on 8.5.12.
- `composer prohibits php 8.5.12` → nothing depends on php in a range excluding 8.5.12.
- `config.platform` is unset (no pinned resolver PHP). **No dependency upgrades were needed.**

## Results on PHP 8.5.12
- **Backend test suite:** 3096 / 3098 pass, 16476 assertions, **zero deprecations, zero errors**. The only
  2 failures are a pre-existing **DST-boundary** bug in `FulfillmentOperationsTest` (Nov 1 2026 is the
  fall-back) that **also fails identically on PHP 8.3.28** — not a PHP 8.5 regression. Tracked separately.
- **PHPStan:** No errors. **Pint:** runs on 8.5.12 (flags 7 pre-existing style deviations in unrelated
  files — not addressed here to avoid mixing changes into the upgrade).
- **SimpleXML regression:** the only SimpleXML path is `MonerisPaymentProvider::parseReceipt`
  (`simplexml_load_string` + `->children()`), verified to parse correctly on 8.5.12 — the known 8.5.x
  SimpleXML regression does not affect it.
- **dompdf** invoice PDF generation: valid `%PDF` output on 8.5.12.
- **Encrypted payment configuration** (sodium/openssl) + the full Payments suite: pass.
- **API output:** clean JSON on every endpoint checked — no deprecation/warning/notice leakage before or
  within responses.
- **VMWebs Commerce plugin** PHPUnit: 42 tests / 231 assertions OK on 8.5.12. Plugin + NH Dream Cake theme
  PHP lint: 0 errors. **WordPress 7.1.3** homepage + product/cart/checkout pages render 200, no PHP errors.
- **Frontend** (PHP-independent, verified as part of the full app): `npm run build` (tsc + vite) OK,
  ESLint 0 errors, Vitest green.
- **Browser (Playwright, backend on 8.5.12):** Dashboard, POS, Customers directory/profile, Orders
  list/detail, Fulfillment dashboard, Payment-gateway settings — all load with 0 console errors, no PHP
  leakage and no API 5xx. WordPress home + shop/cart/checkout render clean.

## Remaining concerns
- The 2 pre-existing DST-boundary production-queue test failures (not PHP-version related).
- 7 pre-existing Pint style deviations in unrelated files.
Neither blocks running on PHP 8.5.12.
