The Fiber class

(PHP 8 >= 8.1.0)

Introduction

Fibers represent full-stack, interruptible functions. Fibers may be suspended from anywhere in the call-stack, pausing execution within the fiber until the fiber is resumed at a later time.

Class synopsis

finalclassFiber {
public__construct(callable$callback)
publicstart(mixed...$args): mixed
publicresume(mixed$value = null): mixed
publicthrow(Throwable$exception): mixed
publicgetReturn(): mixed
publicisStarted(): bool
publicisSuspended(): bool
publicisRunning(): bool
publicstaticsuspend(mixed$value = null): mixed
publicstaticgetCurrent(): ?Fiber
}

Table of Contents

To Top