Fibers: Cooperative Concurrency
Pause and resume PHP execution with Fibers for async-like patterns.
What Are Fibers?
PHP 8.1 introduced Fibers — lightweight coroutines that can pause execution at a specific point and be resumed later, enabling cooperative multitasking.
Fiber vs Async
Fibers are not parallel threads — PHP is still single-threaded. Fibers allow one execution context to voluntarily yield control to another, enabling async-like patterns.
All lessons in this course
- Match Expression and Named Arguments
- Nullsafe Operator and Union Types
- Enumerations (Enums)
- Fibers: Cooperative Concurrency