• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dg / bypass-finals / 40209263193
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: deny-paths-exceptions
DEFAULT BRANCH: master
Ran 25 Oct 2026 03:56PM UTC
Jobs 1
Files 5
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Oct 2026 01:27PM UTC coverage: 83.835%. First build
40209263193

push

github

dg
opcache is switched off by enable()

BypassFinals removes the keywords while a file is being read: its stream
wrapper takes over file:// and modifies the source in stream_open(). Opcache
undermines that. A script it already holds in the cache is served without
the file being opened at all, so the wrapper never runs, and the cache does
not care who put the script there. Two things go wrong:

- A class stays final. When the script was cached before, by the same
  process or by another one sharing the cache, require gives the original
  compiled code and the mock of the class fails with "Class ... is final".
- The modified code leaks out. A script compiled through the wrapper is
  cached with the keywords removed, and every other process sharing the
  cache gets the class without final or readonly, although it never
  enabled BypassFinals.

The cache is shared more often than it seems: by every worker of a php-fpm
pool, by php-cgi processes running at the same time on Windows (which is
what Tester does with -p php-cgi and parallel jobs), and across processes
and runs by opcache.file_cache, typical for the CLI in containers. The CLI
alone is usually safe only because opcache.enable_cli is off by default.

It is not hypothetical, the test suite of BypassFinals itself shows it:
under php-cgi with opcache on, every parallel run failed in three to seven
tests (allowPaths, denyPaths, cache, cache-autocreate, bootstrap, ...), the
fixtures being cached by whichever test loaded them first. With this change
thirty runs passed; overloaded.opendir still fails now and then, but for
a race of its own with removeFinals.syntax-error over the fixtures
directory, which happens with opcache off too.

Opcache can be switched off at runtime (only off, not on again). From then
on the process neither reads the cache nor writes into it, so every script
is compiled from what the wrapper serves. enable() does it right before it
registers the wrapper. The cost, compiling without t... (continued)

1 of 1 new or added line in 1 file covered. (100.0%)

223 of 266 relevant lines covered (83.83%)

0.84 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40209263193.1 25 Oct 2026 03:56PM UTC 5
83.83
GitHub Action Run
Source Files on build 40209263193
  • Tree
  • List 5
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40209263193
  • 295d8549 on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc