Skip to content

CI: run PHPUnit with opcache.enable_cli=1 for faster, more realistic test runs #605

Description

@satwareAG-ironMike

Context

While verifying Bergmann's OPcache optimizer article (phpunit.expert, 2026-08-26) we confirmed on PHP 8.5.9 that:

  • opcache.enable_cli defaults to 0, so PHPUnit runs execute unoptimized bytecode (~14% slower on suite-like workloads, 21% on a call-heavy microbench of 30M userland calls: min 1191 ms vs 1515 ms).
  • Enabling it makes CI runs faster AND exercises the same optimized handler paths production uses (type-specialized handlers are selected whenever OPcache loads).

Proposal

In CI workflows (and optionally composer test scripts), enable the CLI optimizer explicitly:

php -d opcache.enable_cli=1 -d opcache.optimization_level=0x7FFEBFFF vendor/bin/phpunit

Note: pinning optimization_level matters - at least one workstation was found silently running with it zeroed (harness issue tracked separately). Sibling repo doctrine-firebird-driver has the same pattern and may want the same change.

Acceptance criteria

  • CI job measures suite time before/after enabling; keep if stable improvement
  • Flags documented where contributors will find them (CI yaml comment or docs)

Filed from satware.ai/harness findings session 2026-08-26.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions