PHP 8.3 vs 8.4 vs 8.5: Real-World Performance Benchmark (2026)

PHP 8.5 was released in late 2025, bringing new syntax features like the pipe operator (|>) and improved JIT compilation. But how much faster is it compared to PHP 8.3 and 8.4 in real-world scenarios?

I ran 1,000 requests with 15 concurrent users on identical hardware, testing CPU-intensive workloads (Fibonacci calculation + loop operations). The results show that PHP 8.5 offers modest improvements, while PHP 8.3 remains a solid choice for production.

This benchmark is fully reproducible—all test scripts and commands are included below.

Test Environment

ComponentSpecification
CPUIntel(R) Xeon(R) Platinum 4-core (vCPU)
RAM8GB ECC
OSUbuntu 22.04.5 LTS
Web ServerNginx 1.24
PHP VersionsPHP 8.3.30, PHP 8.4.17, PHP 8.5.2
PHP-FPMstatic processes, pm.max_children = 20
OPcacheEnabled, JIT disabled (for consistency)
Test ToolApache Bench (ab)
Concurrency1 (single request at a time)
Total Requests1,000 per test
Warm-up100 requests before each run

Methodology

To ensure reliable and reproducible results, we followed a strict procedure:

  1. Test script – A CPU‑heavy script was used, consisting of:
    • Recursive Fibonacci calculation up to fibonacci(35) (≈ 18 million function calls).
    • 1,000,000 iterations of mathematical operations (sqrt() and sin()).
    • The script outputs only a fixed string "OK" so that every response has the exact same length – a requirement for clean ab results.
  2. Memory measurement – Peak memory usage was captured with memory_get_peak_usage(true) and appended to a log file after each request.
  3. Each PHP version was tested with five independent runs of 1000 requests each.
  4. For every metric, the highest and lowest values were discarded, and the remaining three were averaged.
  5. All tests used a concurrency of 1 to isolate CPU performance from network or process‑pool effects.
  6. The server was restarted between version tests to clear any caches.

The same test script was used across all PHP versions with identical configuration.

Results

Test RunPHP 8.3.30
(req/s / ms)
PHP 8.4.17
(req/s / ms)
PHP 8.5.2
(req/s / ms)
Run 11.64/611.2371.53/654.9641.78/562.906
Run 21.63/614.8941.53/653.8891.78/560.043
Run 31.62/615.7471.52/658.1341.78/560.935
Run 41.63/613.6461.53/653.9521.78/559.599
Run 51.63/613.2041.52/656.2541.78/554.903
Average (after filtering)1.63 / 613.911.53 / 655.061.78 / 560.19

Key Metrics Comparison

MetricPHP 8.3.30PHP 8.4.17PHP 8.5.2
Avg Requests/sec1.631.531.78
Avg Time per Request (ms)613.91655.06560.19
Memory Peak (MB)222
Error Rate0%0%0%

Analysis

The data reveals clear differences among the three PHP versions under this CPU‑intensive workload:

  • PHP 8.5.2 delivers the best performance, achieving 1.78 req/s with an average response time of 560 ms. This is an improvement of approximately 9% over PHP 8.3.30 and 16% over PHP 8.4.17 in throughput.
  • PHP 8.3.30 comes second with 1.63 req/s and 614 ms response time. It remains a solid performer, only slightly behind the newest release.
  • PHP 8.4.17 is the slowest in this test, with only 1.53 req/s and 655 ms response time. The drop compared to 8.3 is unexpected and may point to a temporary performance regression in certain CPU‑heavy scenarios (similar issues have been noted in community discussions). The absolute difference, however, is modest (≈6–7% slower than 8.3).
  • Memory usage is identical across all versions (2.0 MB peak), confirming that the performance gains come from execution efficiency rather than reduced memory footprint.
  • The very low standard deviation across runs (especially for PHP 8.5.2) demonstrates the consistency of the test environment and the stability of the modern PHP engine.

These results align with the general trend: PHP 8.5 introduces optimizations that can significantly benefit computation‑intensive code, while PHP 8.4 may exhibit slight regressions in some edge cases. For typical web applications the differences are small, but for tasks that are heavy on CPU (e.g., data processing, complex calculations), upgrading to 8.5 can provide a measurable boost.

Should You Upgrade to PHP 8.5?

Pros:

  • New language features (pipe operator |>, URI extension)
  • Measurable performance gains in CPU-intensive tasks (our benchmark showed a ~9% improvement over PHP 8.3)
  • Better debugging support and error messages

Cons:

  • Not yet fully supported by all frameworks and CMSs (WordPress 6.9 has beta support only)
  • For typical web applications, gains may be modest (1-3%), but for computation-heavy workloads, PHP 8.5 can provide a noticeable boost.
  • May require testing for extension compatibility

Conclusion

Based on this benchmark:

  • If you are on PHP 8.3 and your application runs CPU‑heavy workloads, upgrading to PHP 8.5.2 can yield a ~9% performance gain without increasing memory usage. New syntax features like the pipe operator (|>) are an added bonus.
  • If you are on PHP 8.4, you may experience a slight performance dip compared to 8.3 in some scenarios. It is advisable to test your own application before committing to 8.4, or consider jumping directly to 8.5.
  • For WordPress or typical CMS users, the performance differences are unlikely to be noticeable in day‑to‑day use. PHP 8.3 remains a safe, widely compatible choice.
  • All three versions are stable and error‑free, so the decision should be guided by feature needs and extension compatibility.

We strongly recommend testing with your own application code, as real‑world results can vary. The scripts and methodology used here are provided below for reproduction.

This benchmark is part of our PHP performance series. See also: PHP 7.4 vs 8.5 evolution.

We later expanded this single-workload test into a full PHP 8.3 vs 8.4 vs 8.5 performance comparison, testing all three versions under light I/O, 50ms, and 200ms database latency.

Test Scripts (for Reproducibility)

notes:Please execute the following command on your own independent testing server and do not perform stress testing on any production environment websites!
# 1. Test PHP 8.3.30
ab -n 1000 -c 1 https://phpbenchlab.com:8081/test.php
# 2. Test PHP 8.4.17
ab -n 1000 -c 1 https://phpbenchlab.com:8082/test.php
# 3. Test PHP 8.5.2
ab -n 1000 -c 1 https://phpbenchlab.com:8083/test.php
# 4. Monitor system resources during test
htop

PHP Test Script

<?php
// Disable execution time limit
set_time_limit(0);
// Test function 1: Recursive Fibonacci (CPU-intensive)
function fibonacci($n) {
    if ($n <= 1) return $n;
    return fibonacci($n-1) + fibonacci($n-2);
}
// Test function 2: Loop operations
function loopTest($iterations) {
    $result = 0;
    for ($i = 0; $i < $iterations; $i++) {
        $result += sqrt($i) * sin($i);
    }
    return $result;
}
//Perform testing
fibonacci(35);
loopTest(1000000);
//Record memory peak value (in bytes)
$memoryPeak = memory_get_peak_usage(true); // Use true to obtain the actual memory allocated by the system
file_put_contents('/tmp/php_memory.log', date('Y-m-d H:i:s') . " - Memory peak: " . round($memoryPeak / 1024 / 1024, 2) . " MB\n", FILE_APPEND);
//Only output fixed content to ensure stability of ab testing
echo "OK";
?>

Frequently Asked Questions

Q: Why did you disable JIT?

A: JIT (Just‑In‑Time compilation) can behave differently across PHP versions and may introduce additional variables that obscure core performance differences. By disabling JIT, we ensure a level playing field where the results reflect the intrinsic speed of each PHP engine. Production environments with JIT enabled might see different results, so we encourage you to test with your own configuration.

Q: Can I run these tests on my own server?

A: Absolutely. All test scripts and ab commands are provided in the “Test Scripts” section. We strongly recommend using an isolated test environment (e.g., a separate VPS or local virtual machine) to avoid impacting production sites and to guarantee that no other services skew the results.

Q: Which PHP version do you recommend for WordPress?

A: For WordPress sites, PHP 8.3 remains the safest choice at the moment. While PHP 8.5 offers performance gains and new syntax features, official WordPress support is still in beta. We advise waiting until PHP 8.5 is fully supported by WordPress core, your theme, and your plugins before upgrading. As always, test thoroughly in a staging environment first.

Leave a Comment