PHP 8.4.6 Released!

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

final class Fiber {
/* Methods */
public __construct (callable $callback)
public start (mixed ...$args): mixed
public resume (mixed $value = null ): mixed
public throw (Throwable $exception): mixed
public getReturn (): mixed
public isStarted (): bool
public isSuspended (): bool
public isRunning (): bool
public isTerminated (): bool
public static suspend (mixed $value = null ): mixed
public static getCurrent (): ? Fiber
}

See Also

Fibers overview

Table of Contents

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /