fiber-interop

Conformance

Every adapter runs the same 25 examples from the api and must print identical output. Results are produced by CI from the current main of every repository, daily and on every push.

Summary

RuntimeLibrary / extension version testedPHPResultScope through native spawnsStressRun at
AMPHPadapter b1194dd, amphp/amp v3.1.3, php 8.4.27, api 4792deb8.4.27all 25 passyes6/62026-11-11 11:53 UTC
OpenSwoole (swoole adapter)adapter 2ed027f, ext-openswoole 25.2.0, php 8.4.27, api 4792deb8.4.27all 25 passno, via fiber\go() only6/62026-11-11 11:55 UTC
phasyncadapter 6750592, phasync/phasync 2.0.10, php 8.4.27, api 4792deb8.4.27all 25 passyes6/62026-11-11 11:53 UTC
ReactPHPadapter 4edf221, react/async v4.3.0, react/event-loop v1.6.0, php 8.4.27, api 4792deb8.4.27all 25 passno, via fiber\go() only5/62026-11-11 11:54 UTC
Revoltadapter 4fdce62, revolt/event-loop v1.0.9, php 8.4.27, api 4792deb8.4.27all 25 passyes6/62026-11-11 11:53 UTC
Swooleadapter 2ed027f, ext-swoole 6.2.3, php 8.4.27, api 4792deb8.4.27all 25 passno, via fiber\go() only6/62026-11-11 11:54 UTC
TrueAsyncext-true_async 0.11.7, php 8.6.0-dev, api 8.6.0-devall 25 passno, via fiber\go() only6/62026-11-11 11:55 UTC
reference adapter (api test double)adapter 4792deb, php 8.4.27, api 4792deb8.4.27all 25 passnot run6/62026-11-11 11:53 UTC

All runs used the api at commit 4792deb.

Scope probes

The 25 examples above are the conformance contract. The probes below are an extra measurement: whether Scope also follows code that uses the runtime's own API directly, without going through fiber-interop. A "no" there is a property of the runtime, not a failure.

Three standalone scripts per adapter show how far per-scope state (including superglobals) follows the code. api proves that code driven through the fiber-interop api keeps its scope; loop proves the same for code using the loop's own primitives; raw fiber proves that a plain Fiber keeps the scope of its creator.

A userland polyfill sees only the switches that pass through a hook it controls: everything under Revolt and AMPHP, callbacks but not await() under ReactPHP, nothing Swoole performs itself. Covering every switch needs the runtime: the engine for fibers (the case made in the the Scope RFC (draft)), and for Swoole the two switch hooks its core already has but does not expose to PHP. The ext-scope columns run the same probes with the native extension loaded. The extension provides the identity; per-scope superglobals are the RFC's secondary vote and are not in the extension yet, so api and loop fail there today and raw fiber passes. That is the measurement, not a defect of the extension.

Runtimeapiloopraw fiber
polyfillext-scopepolyfillext-scopepolyfillext-scope
AMPHPokokokokokok
OpenSwoole (swoole adapter)okoknonookok
phasyncokokokokokok
ReactPHPokoknonookok
Revoltokokokokokok
Swooleokoknonookok
TrueAsyncokFAILnonookno
reference adapter (api test double)not runnot runnot runnot runnot runnot run

Exceptions

Full matrix

Show the full matrix (examples by runtimes)
ExampleAMPHPOpenSwoole (swoole adapter)phasyncReactPHPRevoltSwooleTrueAsyncreference
01-go-awaitgo() and await() return a task resultokokokokokokokok
02-outside-run-throwsgo/await/sleep throw outside run(); run() worksokokokokokokokok
03-sleep-interleavessleep() interleaves tasks by durationokokokokokokokok
04-timeout-leaves-task-runningawait timeout throws; the task keeps runningokokokokokokokok
05-late-result-ignoreda result arriving after a timeout is ignoredokokokokokokokok
06-exception-rethrown-unchangedtask exceptions are rethrown unchangedokokokokokokokok
07-rejected-non-throwablenon-Throwable rejection becomes RejectedExceptionokokokokokokokok
08-await-thenableany then(ok, fail) object is awaitableokokokokokokokok
09-await-allawait_all returns results under the same keysokokokokokokokok
10-await-anyawait_any returns the first fulfilled resultokokokokokokokok
11-readable-concurrentseveral fibers wait readable() on one streamokokokokokokokok
12-writablewritable() waits and returns the resourceokokokokokokokok
13-scope-inherited-by-gogo() tasks inherit the starter's Scopeokokokokokokokok
14-scope-in-queued-callbackqueued callbacks resume tasks in their own Scopeokokokokokokokok
15-in-place-foreign-fiberforeign fibers wait in place inside run()okokokokokokokok
16-unhandled-exception-reaches-handlerunhandled service errors reach the error handlerokokokokokokokok
17-await-is-repeatablean awaitable can be awaited repeatedlyokokokokokokokok
18-run-is-structuredrun() waits for every task started inside itokokokokokokokok
19-nested-runnested run() waits only for its own tasksokokokokokokokok
20-service-does-not-block-runa service() task does not delay run()okokokokokokokok
21-superglobals-per-scope$_GET is per scope; each scope sees its ownokokokokokokokok
22-readiness-on-closereadable()/writable() return on peer close and on local close: readiness means the next operation will not blockokokokokokokokok
23-currentcurrent() is the handle go() returned for the running taskokokokokokokokok
24-cancelcancel() makes a task's current or next wait throw the reasonokokokokokokokok
25-frame-cancelframe() is the current run(); cancel(frame()) ends every task of it, nested run()s included;okokokokokokokok
Passing25/2525/2525/2525/2525/2525/2525/2525/25

skipped means the runtime could not be run in that environment.

See the specification for what the conformance set does and does not prove.