Distinguish intentional JIT disable from unexpected failure in status message#11681
Open
Distinguish intentional JIT disable from unexpected failure in status message#11681
Conversation
When opcache is loaded but JIT is off, Psalm displays a misleading
"an error occurred while enabling JIT" message even when JIT was
intentionally disabled (e.g. via -d opcache.jit=disable to work
around PHP JIT segfaults during taint analysis).
This change checks ini_get('opcache.jit') to distinguish between
intentional disabling and unexpected failure, showing a clean
informational message in the former case.
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When opcache is loaded but JIT is off, Psalm currently displays:
This is misleading when JIT was intentionally disabled (e.g. via
-d opcache.jit=disableto work around PHP JIT segfaults during taint analysis).This PR checks
ini_get('opcache.jit')to distinguish between intentional disabling and unexpected failure:off,disable,0, etc.) →"JIT acceleration: OFF (opcache.jit is disabled)"Context
We hit JIT segfaults (exit code 139) running
--taint-analysison a large Laravel codebase (~3400 files). The workaround isPSALM_ALLOW_XDEBUG=1+-d opcache.jit=disable, but the alarming error message causes confusion.Limitations
This is a minimal DX fix for the misleading message only. It does not address the underlying issue that
PsalmRestarterforce-enables JIT regardless of user intent.The proper solution would be making JIT opt-in rather than forced — @theodorejb's approach in #11613 is the right direction for that. The benchmarks in #11589 consistently show JIT hurting performance across platforms, and it also causes stability issues (segfaults) during taint analysis. I'd love to see that work land.
Fixes messaging issue from #11589