Fibers are the deepest conceptual shift PHP has made in years.
They’re not “faster loops” or “threads”.
They’re a new way to express pausable execution
— a quiet, controlled form of concurrency that keeps PHP’s single‑threaded mental model intact.
Fibers introduce a way to pause and resume execution without breaking PHP’s single‑threaded nature.
They give us concurrency without chaos
— a controlled, cooperative model where the developer decides when execution yields.
They reflect a broader shift in modern PHP:
→ asynchronous behavior should be explicit, predictable, and safe.
A Fiber is a small, self‑contained unit of execution that can be paused (suspend) and resumed (resume) manually.
$fiber = new Fiber(function () { $value = Fiber::suspend('waiting'); return "resumed with $value"; }); $result = $fiber->start(); // 'waiting' $result = $fiber->resume('data'); // 'resumed with data'
Nothing happens automatically.
Nothing runs in parallel.
Everything is explicit.
Fibers reduce:
They give frameworks a foundation for async I/O
without changing PHP’s core execution model.
A Fiber is a function we can pause.
- Not a thread.
- Not a process.
- Not parallel execution.
The key idea:
→Fibers give us concurrency without losing the simplicity of sequential code.
We write code that looks synchronous,
but behaves cooperatively.
Without Fibers (callback style):
fetchData(function ($data) { process($data); });
With Fibers (cooperative style):
$fiber = new Fiber(function () { $data = Fiber::suspend(); process($data); }); $fiber->start(); $fiber->resume(fetchData());
The flow becomes readable.
The behavior becomes predictable.
Fibers are not for everyday PHP.
They are for frameworks and libraries that need structured concurrency.
They shine in:
Most developers will use Fibers indirectly
— through libraries that build on top of them.
Avoid them when:
Fibers are a foundation,
not a pattern to sprinkle everywhere.
AI often:
Our mental model helps us see when a Fiber expresses real concurrency
—and when AI is using it simply because it “looks asynchronous”.
Fibers bring cooperative concurrency to PHP without breaking its single‑threaded nature.
They make asynchronous behavior explicit, predictable, and readable.
Once we internalize this,
we can immediately see when AI‑generated code:
Fibers are a deep feature
— but they teach us
how modern PHP wants to express concurrency with clarity and control.