What are Fibers in PHP, and how do they enable 'cooperative multitasking' without being true threads?

Last updated 15 June 2026

  • Fibers (PHP 8.1) are pausable functions: new Fiber($callable) then start(), Fiber::suspend($value) to pause, and resume($value) to continue.

  • Multitasking is cooperative: a Fiber runs until it voluntarily suspends and is never interrupted, so only one touches memory at a time (no locks or races).

  • They are not threads: all Fibers share one thread and core. They are a low-level primitive usually driven by AMPHP or ReactPHP event loops.

  • https://www.php.net/manual/en/language.fibers.php
  • https://www.php.net/manual/en/class.fiber.php
  • https://codewithkyrian.com/writing/php-fibers-the-missing-piece-for-elegant-cooperative-multitasking/
  • https://dev.to/gabrieloliverio/concurrency-and-parallelism-in-php-part-1-21m5
  • https://itsimiro.medium.com/understanding-fibers-in-php-a-new-way-to-handle-concurrency-ed07424320ff
  • https://synpass.pro/case-studies/mastering-php-fibers-harnessing-concurrency-for-modern-php-applications/
  • https://php.watch/versions/8.1/fibers
  • https://aoeex.com/phile/php-fibers-a-practical-example/
All PHP interview questions