Method
phasync::getFiber
Returns the running coroutine.
Description#
public static phasync::getFiber(): FiberReturn values#
Fiber
Errors / Exceptions#
| Exception | When |
|---|---|
LogicException | Outside a coroutine |
Examples#
phasync::run(function () {
$fiber = phasync::getFiber();
var_dump($fiber->isRunning()); // true
});See also#
phasync::goStarts$fnas a coroutine in the current frame and scope, and returns it, without waiting for it.