AL+

Language: RO (română) EN (English)

Email us: paul@alplustech.com

Looking back at the week of 12–18 February 2025

PHP JIT should earn its place in your workload

PHP's February 2025 fixes support a practical rule: keep JIT when representative workload evidence justifies its cost and configuration stays reversible.

Citiți articolul în română

Keep PHP JIT enabled when representative workload evidence justifies it and the team can reverse the configuration deliberately. The existence of a compiler optimization does not establish a useful gain for a service whose requests spend most of their time waiting on databases or external systems. Equally, a historical bug report cannot establish that JIT is unsuitable for every application.

Looking back from November 2026, PHP's February 2025 fixes provide a concrete reason to make this a configuration decision. The PHP 8.4.4 changelog, dated 13 February 2025, includes fixes for a minimal-JIT segmentation fault, an internal-closure JIT failure and an assertion in the JIT implementation. The 2025 news archive identifies 8.4.4 as a bug-fix release.

These entries establish specific historical fixes. They do not measure how frequently a production application encountered the defects, and they supply no benchmark for the reader's workload. They also do not recommend running 8.4.4 today. A present-day decision needs a currently maintained PHP release and the actual configuration deployed with it.

Opcode caching and JIT solve different problems

Opcode caching keeps compiled PHP bytecode available so that repeated requests do not need to repeat the same source-compilation work. JIT adds native-code compilation for selected execution paths. Turning off JIT need not mean turning off OPcache; confusing those controls makes a performance comparison difficult to interpret.

The OPcache configuration manual, a mutable reference consulted in November 2026, documents the relevant settings and their version qualifications. It distinguishes opcache.jit=disable, which cannot be enabled at runtime, from off, which permits runtime enabling. It also documents that a zero JIT buffer disables JIT. Those meanings matter when preparing a repeatable configuration change.

Do not copy a configuration fragment without checking which PHP version and execution environment it applies to. A command-line process and a web worker may read different configuration files. An intended JIT comparison can become a comparison between unrelated environments if the effective settings are never recorded.

For the business, the useful output is a decision that an operator can reproduce. “JIT is enabled somewhere” provides little help when an incident occurs. The record should identify the runtime package, effective settings and the procedure that makes a change take effect in the actual workers.

The workload determines the opportunity

A CPU-heavy calculation expressed in PHP can offer JIT useful work to accelerate. The result remains conditional on the code shape, runtime and surrounding costs. A large amount of computation performed inside a native extension is different from the same amount expressed as PHP operations; the place where time is spent matters.

An I/O-heavy service offers a different opportunity. If a request mostly waits for a remote response, making a smaller compute section faster may leave the user's wait largely unchanged. That is a causal argument about time spent, not a benchmark or a claim that all web applications are I/O-bound.

An illustrative reporting worker might perform substantial PHP calculations after fetching its input. An illustrative customer portal might mostly wait for a database and another service. These examples suggest different candidates for evaluation. They are not AL+ projects, observed performance results or predictions of a particular percentage improvement.

Even within one application, the web path and a long-running worker can have different behavior. A result for one should not automatically determine the configuration of the other. Shared configuration can simplify operations, but that simplification has to be weighed against evidence from the work each process actually does.

Measure completed work under comparable conditions

A proposed evaluation should compare the same maintained runtime, application revision and representative inputs with the JIT setting changed deliberately. Keep opcode caching conditions comparable. Record warm-up behavior, resource use, errors and the outcome the business cares about, such as completion time for an accepted report.

This is a proposed method, not an experiment performed for this article. There is no invented result to justify enabling or disabling JIT. The point is to prevent an attractive microbenchmark from answering a different question than the service owner asked.

Include difficult inputs and realistic concurrency where they matter. A fast average can conceal a problematic tail or a worker failure. Define what improvement would be worth keeping and what regression would cause rejection before interpreting the observations. Otherwise any small difference can become a story supporting the team's preferred setting.

The strongest counterargument is that a mature deployment may already have convincing workload evidence and stable operation with JIT. Requiring another evaluation merely because a retrospective mentions old fixes would waste effort. Existing relevant evidence should count, provided the runtime, workload and operating conditions have not changed enough to invalidate it.

Reversibility includes the running processes

A reversible setting needs a recorded previous configuration and a supported way to replace or restart the affected workers. Editing a file is insufficient if existing processes retain the old state. Choose the procedure for the actual deployment model, and confirm the effective configuration after the change.

Reverting a JIT setting is also different from reverting a PHP security update. If a JIT-related problem can be isolated through configuration, retaining the maintained runtime while disabling that feature may avoid reopening unrelated defects. Whether that response is appropriate depends on the incident; a changelog alone cannot diagnose it.

In custom software development, ask for the smallest performance decision that the evidence supports. Find where time is spent, distinguish OPcache from JIT and keep a clear route back to the previous setting. Retain JIT when completed work benefits enough to justify its operating cost, and revisit the decision when the workload changes.