<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx" -->

---
title: How PHP optimises bytecode | daily.dev
description: An in-depth look at PHP's OPcache reveals it is far more than a simple bytecode cache. The piece walks through the fifteen optimization passes that run between...
canonical: https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How PHP optimises bytecode | daily.dev
og:description: An in-depth look at PHP's OPcache reveals it is far more than a simple bytecode cache. The piece walks through the fifteen optimization passes that run between...
og:url: https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx
og:image: https://api.daily.dev/og/posts/O3uIqDRvx.png
og:image:alt: How PHP optimises bytecode
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How PHP optimises bytecode

**[PHP Dev](https://daily.dev/sources/phpdev)** · [@sebastianbergmann](https://daily.dev/sebastianbergmann) · 1 min read · 6 upvotes · 0 comments

## Summary

An in-depth look at PHP's OPcache reveals it is far more than a simple bytecode cache. The piece walks through the fifteen optimization passes that run between compilation and execution, measuring how much of the optimized bytecode actually persists into runtime and what that means for performance.

## Content

OPcache is called a cache, but it does more than keep bytecode around: fifteen passes sit between the compiler and the executor and rebuild it. I watch them at work and measure how much of it survives into the run time:

[https://phpunit.expert/articles/how-php-optimises-bytecode.html?ref=dailydev](https://phpunit.expert/articles/how-php-optimises-bytecode.html?ref=dailydev)

## Similar posts on daily.dev

- [How PHP executes bytecode](https://daily.dev/posts/how-php-executes-bytecode-nmrpdr8hr) · PHPUnit Expert · 19 upvotes · 1 comments
- [How PHP generates machine code](https://daily.dev/posts/how-php-generates-machine-code-zwfynbekr) · PHPUnit Expert · 14 upvotes · 1 comments
- [Two studies in compiler optimisations · hmpc](https://daily.dev/posts/two-studies-in-compiler-optimisations-hmpc-scky7w9iq) · Hacker News · 0 upvotes · 0 comments
- [How JavaScript learned to cheat — A Deep Dive into the JS Engine](https://daily.dev/posts/how-javascript-learned-to-cheat-a-deep-dive-into-the-js-engine-aqrk9b7iq) · Medium · 1 upvotes · 0 comments
- [Inside the Go Compiler: Optimizations That Make Your Code Faster – Josh Software](https://daily.dev/posts/inside-the-go-compiler-optimizations-that-make-your-code-faster-josh-software-2ovry6obu) · RUBYLAND · 5 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx","headline":"How PHP optimises bytecode","text":"An in-depth look at PHP's OPcache reveals it is far more than a simple bytecode cache. The piece walks through the fifteen optimization passes that run between compilation and execution, measuring how much of the optimized bytecode actually persists into runtime and what that means for performance.","url":"https://daily.dev/posts/how-php-optimises-bytecode-o3uiqdrvx","datePublished":"2026-08-26T04:30:51.000Z","dateModified":"2026-09-13T21:17:45.695Z","author":{"@type":"Person","name":"Sebastian Bergmann","url":"https://daily.dev/sebastianbergmann","image":"https://media.daily.dev/image/upload/s--C1spaGmt--/f_auto/v1769079877/avatars/avatar_Yy0cnkFhv4SEvnBDkKVDx?_a=BAMAMiiu0","description":"Created PHPUnit. Co-Founded thePHPcc. Helps developers build better software.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":870}},"image":"https://media.daily.dev/image/upload/s--4oahTx0U--/f_auto/v1787716331/posts/3E5DWuSB1?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/phpdev","name":"PHP Dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHP Dev","item":"https://daily.dev/squads/phpdev"},{"@type":"ListItem","position":3,"name":"How PHP optimises bytecode"}]}
```

