Skip to content

Support PHP 8.6 - #4

Merged
VitaliyBoyko merged 3 commits into
developfrom
fix/php-86-compatibility
Nov 28, 2026
Merged

VitaliyBoyko merged 3 commits into
developfrom
fix/php-86-compatibility

Conversation

@VitaliyBoyko

@VitaliyBoyko VitaliyBoyko commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Support stable Linux non-thread-safe (NTS) PHP 8.6 while retaining PHP 8.3–8.5 compatibility (v2.1.4), without changing the binary coverage record or manifest format.

Behavioral Contract & Key Changes

  • PHP 8.6 Zend API compatibility (pcov.c, pcov_request_cache.h, config.m4, composer.json):
    • Replace removed Zend INI convenience macros (INI_INT, INI_BOOL, INI_STR) with zend_ini_long(ZEND_STRL(...), 0) and zend_ini_string_ex(ZEND_STRL(...), 0, NULL) (using compile-time string lengths with zero hot-path overhead).
    • Match const char * signatures and uint32_t zend_cfg.blocks_count iteration for clean -Wall -Wextra -Werror builds across PHP 8.3–8.6.
    • Guard the worker-local cache slot under #ifndef ZTS in pcov_request_cache.h so ZTS builds compile cleanly while continuing to bypass the NTS-only mutable worker cache.
    • Preserve -1 uncovered / 1 covered collection semantics, fail-closed manifest validation, atomic export publication, and existing record compatibility.
  • PHP 8.6 NTS CI & test suite (ci.yml, tests/045.phpt–047.phpt, tests/php86_partial.phpt):
    • Switch the PHP 8.6 linux-nts CI container to php:8.6-nts (docker-library/php switched php:8.6-cli to ZTS by default in 8.6) and assert !PHP_ZTS in CI so NTS coverage guarantees cannot silently run against a ZTS runtime.
    • Add PHP_ZTS SKIPIF guards to the NTS-only native worker request-cache tests (tests/045.phpt–tests/047.phpt).
    • Add tests/php86_partial.phpt covering PHP 8.6 partial function application (? / ... placeholders) across pcov\collect() and manifest-backed pcov\export().

Validation & Performance Checks

  • Strict build & PHPT regression suite (CFLAGS="-O2 -Wall -Wextra -Werror"):
    • GitHub Actions CI and local Docker runs pass across Linux NTS PHP 8.3, 8.4, 8.5, and 8.6 (41 passed, 0 failed on php:8.6-nts, including 045.phpt–047.phpt and php86_partial.phpt).
    • Also verified php:8.6-cli (ZTS) builds cleanly under -Werror and skips 045.phpt–047.phpt (skip NTS required).
  • Performance verification (Linux Docker, 1,500 files / 64,500 executable lines / 10 requests per round / 10 rounds):
    • PHP 8.5.13 NTS interleaved A/B (develop 2.1.3 vs PR 2.1.4): identical coverage_hash, wall_ms median 667.67 ms (2.1.3) vs 668.26 ms (2.1.4), export_ms median 6.58 ms vs 6.57 ms, merge_ms median 16.97 ms vs 17.01 ms, max_rss_kb median 56,192 KB vs 56,192 KB (no degradation).
    • PHP 8.6.0 NTS synthetic benchmark (benchmark/large-codebase/run.php): identical coverage_hash, export median 7.38 ms in large-codebase mode vs 85.73 ms in official collect+serialize mode (11.6x faster export, -25.5% output bytes).
    • Native Magento GET worker cache (pcov.request_magento_cache=1, 150 warm requests): warm cache-hit pcov\export() median 23.83 µs on PHP 8.5 (2.1.3), 23.83 µs on PHP 8.5 (2.1.4), and 23.96 µs on PHP 8.6.0 NTS (2.1.4).
  • Missing runtime/platform checks:
    • tests/031.phpt skips when pcntl is not enabled in the stock Docker CLI images.
    • Full Magento 2 storefront benchmark (benchmark/magento/run.py) was not run against a live Magento 2 + PHP 8.6 stack.

PHP 8.6 release notes

@VitaliyBoyko
VitaliyBoyko merged commit e39c85d into develop Nov 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants